12-21-2006 6:34 AM
Hi Friends,
I have created dialog programming report, in which i have created two screens, the first screen has the material input field [mara-matnr], in the second screen i have language and material description fields from makt table [makt-spras, makt-maktx],the launguage and material description will display with respect to the material what we have entered in the screen one.
My query is when i edit the material description field in the screen two and press the update push button, the field what i have edited must update in the table makt,
as it is not happening like that. so please tell me the logic that updates the material description in the table makt when we edit on the screen two.
thanks in advance....
12-21-2006 6:38 AM
Hi,
For updating standard sap tables..Direct table updates should be avoided..Instead use BAPIs or BDC
In this scenario use the BAPI BAPI_MATERIAL_SAVEDATA and the description in the following parameter
MATERIALDESCRIPTION STRUCTURE BAPI_MAKT
Thanks,
Naren
12-21-2006 6:40 AM
Hi,
Write the code for the update button fucntion code(say update) in PAI.
If sy-ucomm = 'UPDATE'.
modify db_table from wa.
endif.
Message was edited by:
Jayanthi Jayaraman
12-21-2006 6:40 AM
we are not suppose to update standard tables directly. we need to go for either BDC or BAPI.
u cant do it through program, u need to do it by calling standrad screens via BDC or BAPI.
Hope this idea may help u.
12-21-2006 6:43 AM
data: wa like makt occurs 1 with header line.
data: begin of wa1,
maktx like makt-maktx,
spras like makt-spras,
end of wa1.
In PAI of second screen write the following code:
case sy-ucomm.
when 'insert'.
move-corresponding wa to wa1.
insert in to makt values wa.
endcase.
Try with these.
Cheers.
12-21-2006 6:44 AM
Hi ,
In the Screen 2 , in the PAI module , in the User Command Module write like this .
case sy-ucomm .
when 'UPDA' .
i_makt-matnr = mara-matnr .
i_makt-spras = mara-spras .
i_makt-maktx = mara-maktx .
append i_makt .
insert makt from table i_makt .
Regards ,
Senthil
12-21-2006 6:53 AM
Hi,
I didnt fully understand your requirement.
MARA,MAKT,MARC are all master data which shouldnt be updated like this..the updation should be from MM02 transaction..You can use a BAPI to update the material Description.
BAPI_MATERIAL_SAVEDATA is one such BAPI which can be used to change the Material Description..
Thanks
Krutiman