2007 Nov 26 9:32 PM
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
2007 Nov 26 9:40 PM
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
2007 Nov 26 9:39 PM
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
2007 Nov 26 9:41 PM
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
2007 Nov 26 9:48 PM
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
2007 Nov 26 9:52 PM
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
2007 Nov 26 9:52 PM
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
2007 Nov 26 9:40 PM
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
2007 Nov 26 9:49 PM
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
2007 Nov 26 9:53 PM
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
2007 Nov 26 10:00 PM
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
2007 Nov 26 10:07 PM
Can you please post your code for selection screen here?
Regards,
Naimesh Patel
2007 Nov 26 10:13 PM
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
2007 Nov 26 10:21 PM
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