Code: Alles auswählen.
DATA: h_name TYPE string,
h_fname TYPE rs38l_fnam,
wa_data TYPE ztdata,
it_data TYPE TABLE OF ztdata.
PARAMETERS:
p_name TYPE char20,
p_kunnr TYPE kna1-kunnr OBLIGATORY.
START-OF-SELECTION.
h_name = p_name.
wa_data-kunnr = p_kunnr.
* SELECT * FROM kna1 INTO CORRESPONDING FIELDS OF TABLE it_data
* WHERE kunnr = p_kunnr.
SELECT v~vbeln v~audat v~netwr v~waerk v~auart k~kunnr
k~name1 k~stras k~telf1 k~telfx
INTO CORRESPONDING FIELDS OF TABLE it_data
FROM vbak AS v INNER JOIN kna1 AS k
ON v~kunnr = k~kunnr
WHERE k~kunnr = p_kunnr.
END-OF-SELECTION.
* diesen Funktionsbaustein brauche ich zum Aufrufen d. Smart Forms
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'Z_CUSTOMERTEST_1'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = h_fname
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3
.
IF sy-subrc <> 0.
EXIT.
ENDIF.
CALL FUNCTION h_fname
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
name = h_name
kunnr = wa_data-kunnr
* i_structure_name = 'ZTDATA'
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
it_data = it_data
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.
IF sy-subrc <> 0.
EXIT.
ENDIF.
Code: Alles auswählen.
CALL FUNCTION h_fname
EXPORTING
name = h_name
* Wann wird wa_data gefüllt
kunnr = wa_data-kunnr
TABLES
it_data = it_data
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.