Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *&---------------------------------------------------------------------*
- *& Report ZLA_RFC_TUTORIAL
- *&
- *&---------------------------------------------------------------------*
- *&
- *&
- *&---------------------------------------------------------------------*
- REPORT zla_rfc_tutorial. "sei su D91
- * Global Data Declaration
- TABLES: spfli.
- PARAMETERS: p_carrid TYPE spfli-carrid DEFAULT 'LH',
- p_connid TYPE spfli-connid DEFAULT '400',
- p_dest TYPE rfcdes-rfcdest DEFAULT 'NONE'.
- DATA: system TYPE sy-sysid,
- flag,
- return TYPE sy-subrc.
- * Calling the Function
- CALL FUNCTION 'LA_RFC_READ_SPFLI' DESTINATION p_dest
- starting new task 'TASK1'
- performing form_results on end of task
- "questo qui è in remoto du d92 per cui crasha senza p_dest
- EXPORTING
- carrid = p_carrid
- connid = p_connid
- * IMPORTING
- * ex_spfli = spfli
- * sys = system
- EXCEPTIONS
- * invalid_data = 1
- communication_failure = 2
- system_failure = 3
- .
- *wait until flag = 'X'.
- if p_dest = 'NONE'.
- write: / 'Adesso crasho'.
- endif.
- * Handling Exceptions
- CASE sy-subrc.
- * WHEN 1.
- * WRITE 'No data available'.
- * EXIT.
- WHEN 2 or 3.
- WRITE 'RFC error'.
- EXIT.
- ENDCASE.
- wait until flag = abap_true.
- IF return <> 0.
- write: 'Error'.
- else.
- WRITE: 'System:', SYSTEM COLOR 4.
- SKIP 2.
- WRITE: spfli-carrid,
- spfli-connid,
- spfli-cityfrom,
- spfli-cityto,
- spfli-deptime,
- spfli-arrtime.
- endif.
- * Displaying Results
- *WRITE: spfli-carrid,
- * spfli-connid,
- * spfli-cityfrom,
- * spfli-cityto,
- * spfli-deptime,
- * spfli-arrtime.
- *WRITE: / 'System:', system COLOR 4.
- *&---------------------------------------------------------------------*
- *& Form FORM_RESULTS
- *&---------------------------------------------------------------------*
- * text
- *----------------------------------------------------------------------*
- * --> p1 text
- * <-- p2 text
- *----------------------------------------------------------------------*
- form form_results using task.
- receive results from function 'LA_RFC_READ_SPFLI' "causa crash dump se la destinazione non è definita
- importing
- ex_spfli = spfli
- sys = system
- exceptions
- invalid_data = 1.
- return = sy-subrc.
- flag = 'X'.
- endform.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement