Tuesday, December 21, 2010
REPORT ztest_notepad.
DATA: it_t399i TYPE t399i OCCURS 0.
DATA:
      it_return_tab TYPE ddshretval OCCURS 0,
      wa_return     LIKE LINE OF it_return_tab.
"Selection screen parameter
PARAMETER : p_swerk TYPE iloa-swerk.

"Process on value request.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_swerk.
  IF it_t399i[] IS INITIAL.
    SELECT * FROM t399i INTO TABLE it_t399i.
  ENDIF.
  "Function module
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'IWERK'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'P_SWERK'
      value_org   = 'S'
    TABLES
      value_tab   = it_t399i
      return_tab  = it_return_tab.
  IF sy-subrc EQ 0.
    "Read the selected record
    READ TABLE it_return_tab INTO wa_return INDEX 1.
    IF sy-subrc EQ 0.
      p_swerk = wa_return-fieldval.
    ENDIF.
  ENDIF.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.