REPORT ZMULTIHELP.
PARAMETERS:
P_EBELN TYPE C LENGTH 20,
P_EBELP TYPE C LENGTH 10.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_EBELN.
DATA:
LT_EKPO TYPE STANDARD TABLE OF EKPO,
LT_FIELDS TYPE STANDARD TABLE OF DFIES,
LT_MAPPING TYPE STANDARD TABLE OF DSELC.
"Fetching only 100 sales documents
SELECT * FROM EKPO
INTO TABLE LT_EKPO
UP TO 100 ROWS.
"Adding the fields we need to be shown in the
"search help
PERFORM ADD_FIELD
TABLES LT_FIELDS
USING 'EKPO'
'EBELN'.
PERFORM ADD_FIELD
TABLES LT_FIELDS
USING 'EKPO'
'EBELP'.
"Adding fields that has to be mapped to
"selection screen fields
PERFORM APPEND_MAPPING
TABLES LT_MAPPING
USING 'EBELN' 'P_EBELN'.
PERFORM APPEND_MAPPING
TABLES LT_MAPPING
USING 'EBELP' 'P_EBELP'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'EBELN'
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_EBELN'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = LT_EKPO
FIELD_TAB = LT_FIELDS
DYNPFLD_MAPPING = LT_MAPPING
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*&------------------------------------------------------*
*& Form add_field
*&------------------------------------------------------*
* Add field info to fieldtab given its table name and
* field name
*-------------------------------------------------------*
* -->TABNAME text
* -->FIELDNAME text
*-------------------------------------------------------*
FORM ADD_FIELD
TABLES P_FIELDS
USING TABNAME TYPE TABNAME
FIELDNAME TYPE FIELDNAME.
DATA: LS_FIELD TYPE DFIES,
LT_FIELDS TYPE STANDARD TABLE OF DFIES.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
TABNAME = TABNAME
FIELDNAME = FIELDNAME
TABLES
DFIES_TAB = LT_FIELDS
EXCEPTIONS
NOT_FOUND = 1
INTERNAL_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
APPEND LINES OF LT_FIELDS TO P_FIELDS.
ENDFORM. "add_field
*&------------------------------------------------------*
*& Form append_mapping
*&------------------------------------------------------*
* Append field mapping to mapping table
*-------------------------------------------------------*
* -->P_MAPPING Mapping table
* -->P_FIELD Field in Itab
* -->P_DYNPRO_FIELD Field in screen
*-------------------------------------------------------*
FORM APPEND_MAPPING
TABLES P_MAPPING
USING P_FIELD
P_DYNPRO_FIELD.
DATA:
LS_MAPPING TYPE DSELC.
LS_MAPPING-FLDNAME = P_FIELD.
LS_MAPPING-DYFLDNAME = P_DYNPRO_FIELD.
APPEND LS_MAPPING TO P_MAPPING.
ENDFORM. "append_mapping
2019年9月24日星期二
订阅:
博文评论 (Atom)
Customer Characteristic
Characteristic Descriptions are stored in the table - CABNT - Language - SPRAS - Characteristic description - ATBEZ Characteristic Values ...
-
REPORT ZBPADD2 . DATA : L_PARTN_CAT TYPE BAPIBUS1006_HEAD - PARTN_CAT , LS_CENTRAL TYPE BAPIBUS1006_CENTRAL , ...
-
HEADER: ADD Customer Fields to structure of IMKPF and BAPI_TE_XMKPF. Items: ADD Customer Fields to structure of IMSEG and BAPI_TE_XMSEG....
-
FUNCTION:SD_SALESDOCUMENT_CREATE Append fiels to Structure below. BAPE_VBAP BAPE_VBAPX VBAPKOZ VBAPKOZX No need to append fields to Struc...
没有评论:
发表评论