Tuesday, December 21, 2010
REPORT ZTEST_prog1. DATA: BEGIN OF IT_MARC OCCURS 0, MATNR TYPE MARC-MATNR, WERKS TYPE MARC-WERKS, END OF IT_MARC. DATA: IT_DYNPREAD TYPE TABLE OF DYNPREAD, WA_DYNPREAD LIKE LINE OF IT_DYNPREAD. DATA: IT_RETURN_TAB TYPE DDSHRETVAL OCCURS 0, WA_RETURN LIKE LINE OF IT_RETURN_TAB. PARAMETERS: P_WERKS TYPE MARC-WERKS, P_MATNR TYPE MARC-MATNR. AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR. WA_DYNPREAD-FIELDNAME = 'P_WERKS'. APPEND WA_DYNPREAD TO IT_DYNPREAD. CLEAR WA_DYNPREAD. "DYNP_VALUES_READ read screen CALL FUNCTION 'DYNP_VALUES_READ' EXPORTING DYNAME = SY-REPID DYNUMB = SY-DYNNR TABLES DYNPFIELDS = IT_DYNPREAD. READ TABLE IT_DYNPREAD INTO WA_DYNPREAD INDEX 1. P_WERKS = WA_DYNPREAD-FIELDVALUE. IF IT_MARC[] IS INITIAL. SELECT * FROM MARC INTO CORRESPONDING FIELDS OF TABLE IT_MARC WHERE WERKS = P_WERKS. ENDIF. "F4 help F4IF_INT_TABLE_VALUE_REQUEST CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST' EXPORTING RETFIELD = 'MATNR' DYNPPROG = SY-REPID DYNPNR = SY-DYNNR DYNPROFIELD = 'P_MATNR' VALUE_ORG = 'S' TABLES VALUE_TAB = IT_MARC RETURN_TAB = IT_RETURN_TAB. IF SY-SUBRC EQ 0. READ TABLE IT_RETURN_TAB INTO WA_RETURN INDEX 1. IF SY-SUBRC EQ 0. P_MATNR = WA_RETURN-FIELDVAL. ENDIF. ENDIF.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
when I was calling this func, sy-dynnr number is '3010' and went to shor dump with 'invalid_dynproname'. I have no idea how I handle it.
ReplyDelete