Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

call screen 2000

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

You can find it out in MAKT.

You have to make sure of the language also.

SELECT SINGLE MAKTX
INTO L_MAKTX
FROM MAKT
WEHRE MATNR = L_MATNR " << FROM THE SCREEN
SPRAS = SY-LANGU.

Regards,

Naimesh Patel

12 REPLIES 12

Former Member
0 Kudos

Hello Mae,

Material desciption van be found in MAKT Table . So for the Material on the Screen go to MAKT table , Pass the same to MATNR and provide the language key and MAKTX field of MAKT hold the material description.

Regards

Saket Sharma

null

0 Kudos

hi,

what i was trying to asked is that is there an "at selection screen" in the new screen which i created?

i none..then what is the alternative for this?

thank you

regards,

mae

0 Kudos

If you have created a screen 2000 in dynpro than you can write down a code to PAI section to facth the material description.

Regards,

Naimesh Patel

0 Kudos

Hello ,

Is the Screen used for Dialog Program or Report Program ?

In Case its a Dialog program , Declare a Screen Field for Material description and mark it as out put only. In your PAI, Say at Sy-UCOMM = 'ENTE' (After Matnr is filled, then user will have to press Enter), Write the Query Mentioned above and fill the value obtained to the Screen Field.

If a Report, then you will have to disable the field for Input in AT SELECTION SCREEN OUTPUT Event.

Regards

Saket Sharma

0 Kudos

Hi Naimesh Patel,

how will i do that?

i'm sorry but i am just new to the screen painter...

can you teach me how to do that?

thank you

regards,

mae

naimesh_patel
Active Contributor
0 Kudos

You can find it out in MAKT.

You have to make sure of the language also.

SELECT SINGLE MAKTX
INTO L_MAKTX
FROM MAKT
WEHRE MATNR = L_MATNR " << FROM THE SCREEN
SPRAS = SY-LANGU.

Regards,

Naimesh Patel

0 Kudos

hi,

When i try it it has an error l_matnr is unknown...

by the way i already have two screen in here the default 1000 and the one which i was created the 2000

thank you

regards,

mae

0 Kudos

ok.. Now, I got it..

You need to use this FM to update your materila description on the screen 2000.


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
WEHRE MATNR = P_MATNR " <<your field from the screen
SPRAS = SY-LANGU.


 
   LNA_DYNPF-FIELDNAME  = 'P_MAKTX'.   " field name 
    LNA_DYNPF-FIELDVALUE = P_MATKX.   " value
    APPEND LNA_DYNPF.
 
 
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
         EXPORTING
              DYNAME               = l_cporg        " 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.

Regards,

Naimesh Patel

0 Kudos

where will i put it because

there is an error p_matnr is unknown but i had already made it in the screen 2000..

please help...

thank you...

regards,

mae

0 Kudos

Can you please post your code for selection screen here?

Regards,

Naimesh Patel

0 Kudos

PARAMETER:

p_werks TYPE t001w-werks,

p_aufnr TYPE afpo-aufnr ,

p_vornr TYPE plpo-vornr ,

p_datum TYPE sy-datum,

p_zsc1 TYPE z2cwarpl-zsc1 OBLIGATORY.

*pushbutton select

SELECTION-SCREEN SKIP 1.

SELECTION-SCREEN PUSHBUTTON /30(10) select USER-COMMAND retr.

when you click on the push button a new selection screen will appear which was i created as the screen 2000:

in the screen 2000 there is a parameter P_matnr wich is a user will input a material number and as long as the user inputted the material number the material description will automatically appear in the same screen...

thank you...

regards,

mae

0 Kudos

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