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: 

Dialog Programming

Former Member
0 Kudos

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....

6 REPLIES 6

Former Member
0 Kudos

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

jayanthi_jayaraman
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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