Code: Alles auswählen.
REPORT.
INCLUDE rvadtabl.
CONSTANTS:
BEGIN OF c_locale,
default_langu TYPE langu VALUE 'D',
default_country TYPE land1 VALUE 'DE',
fallback_langu TYPE langu VALUE 'E',
END OF c_locale.
DATA:
retcode LIKE sy-subrc,
xscreen(1) TYPE c,
gv_form TYPE fpwbformname,
gv_repeat TYPE char2.
FORM entry USING return_code us_screen.
CLEAR retcode.
xscreen = us_screen.
PERFORM processing USING us_screen.
IF retcode NE 0.
return_code = 1.
ELSE.
return_code = 0.
ENDIF.
ENDFORM.
FORM processing USING proc_screen.
PERFORM get_data.
CHECK retcode = 0.
PERFORM form_open USING proc_screen c_locale-default_country.
CHECK retcode = 0.
PERFORM check_repeat.
CHECK retcode = 0.
PERFORM form_write.
PERFORM form_close.
CHECK retcode = 0.
ENDFORM.
FORM get_data.
...
ENDFORM.
FORM form_open USING us_screen us_country .
INCLUDE rvadopfo_pdf.
ENDFORM.
FORM check_repeat.
SELECT * INTO *nast FROM nast
WHERE kappl = nast-kappl
AND objky = nast-objky
AND kschl = nast-kschl
AND spras = nast-spras
AND parnr = nast-parnr
AND parvw = nast-parvw
AND nacha BETWEEN '1' AND '5'
AND vstat = '1'.
gv_repeat = 1.
EXIT.
ENDSELECT.
ENDFORM.
FORM form_write.
DATA:
l_name TYPE rs38l_fnam,
l_docparams TYPE sfpdocparams.
TRY.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = gv_form
IMPORTING
e_funcname = l_name.
CATCH cx_root INTO DATA(e).
MESSAGE e->get_text( ) TYPE 'E'.
ENDTRY.
l_docparams-langu = nast-spras.
l_docparams-replangu1 = c_locale-fallback_langu.
l_docparams-country = c_locale-default_country.
CALL FUNCTION l_name
EXPORTING
/1bcdwb/docparams = l_docparams
.... = ...
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.
FORM form_close .
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc NE 0.
retcode = 1.
PERFORM protocol_update.
ENDIF.
SET COUNTRY space.
ENDFORM.
FORM protocol_update.
CHECK xscreen = space.
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = syst-msgid
msg_nr = syst-msgno
msg_ty = syst-msgty
msg_v1 = syst-msgv1
msg_v2 = syst-msgv2
msg_v3 = syst-msgv3
msg_v4 = syst-msgv4
EXCEPTIONS
OTHERS = 1.
ENDFORM.