Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

call screen 2000

Hi,

i have created a new screen 2000 and in the screen i have some parameter which is a user will input a value of the material and in the same screen i need to output a material description based on the material inputted..

Does any body know how to do this?

thank you regards,

mae

Tags:
Former Member
replied

Ok.. I have created a small test program which works fine for me, it also updates the description of the material.

REPORT  ZTEST_NP.

PARAMETER:
P_WERKS TYPE T001W-WERKS.

*pushbutton select
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN PUSHBUTTON /30(10) SELECT USER-COMMAND RETR.


SELECTION-SCREEN BEGIN OF SCREEN 2000.
PARAMETERS: P_MATNR TYPE MATNR,
            P_MAKTX TYPE MAKTX.
SELECTION-SCREEN END   OF SCREEN 2000.


AT SELECTION-SCREEN.
  CASE SY-UCOMM.
    WHEN 'RETR'.
      CALL SELECTION-SCREEN 2000.
  ENDCASE.

AT SELECTION-SCREEN ON P_MATNR. " << your field for material
  DATA BEGIN OF LNA_DYNPF OCCURS 1.
          INCLUDE STRUCTURE DYNPREAD.
  DATA END OF LNA_DYNPF.

  SELECT SINGLE MAKTX
         INTO P_MAKTX
         FROM MAKT
         WHERE MATNR = P_MATNR
         AND   SPRAS = SY-LANGU.
  IF SY-SUBRC = 0.

    LNA_DYNPF-FIELDNAME  = 'P_MAKTX'.   " field name
    LNA_DYNPF-FIELDVALUE = P_MAKTX.   " value
    APPEND LNA_DYNPF.


    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        DYNAME               = SY-CPROG        " your program
        DYNUMB               = '2000'        " your screen
      TABLES
        DYNPFIELDS           = LNA_DYNPF
      EXCEPTIONS
        INVALID_ABAPWORKAREA = 1
        INVALID_DYNPROFIELD  = 2
        INVALID_DYNPRONAME   = 3
        INVALID_DYNPRONUMMER = 4
        INVALID_REQUEST      = 5
        NO_FIELDDESCRIPTION  = 6
        UNDEFIND_ERROR       = 7
        OTHERS               = 8.

  ENDIF.

Regards,

Naimesh Patel

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question