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: 

editing the values on dialog

Former Member
0 Kudos

hi everyone..

could u please tell me how to edit the values in dialog programming.. e.g i have created 2 screens the first screen wiil have the field vbeln(sd) ... after entering an value it will display the following fileds vbeln , zmeng, netwr,netpr on 2nd screen after tht if we press edit button we must able to edit the values and save them to the respec db table.i need the code, culd u please tell me the popup function modules for deleting a report, renaming and copying a report.

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Initially make the fields in the screen in display mode.

In PAI of the screen,set the flg = 'Y' after the button is pressed.

In PBO of the screen,

LOOP AT SCREEN.

IF flg IS INITIAL.

screen-input = 0.

ELSEIF ( flg EQ 'Y' ).

IF ( screen-name = name of the field ).

  • Making the screen fields as editable

screen-input = 1.

ENDIF.

ENDIF.

  • Modifying the screen after making changes

MODIFY SCREEN.

ENDLOOP.

Hope this helps.If so,reward points.Otherwise get back.

5 REPLIES 5

FredericGirod
Active Contributor
0 Kudos

I don't understand ....

for code to modify report, go to transaction ABAPDOCU -> Abap programming language -> Special tech ..

Frédéric

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Initially make the fields in the screen in display mode.

In PAI of the screen,set the flg = 'Y' after the button is pressed.

In PBO of the screen,

LOOP AT SCREEN.

IF flg IS INITIAL.

screen-input = 0.

ELSEIF ( flg EQ 'Y' ).

IF ( screen-name = name of the field ).

  • Making the screen fields as editable

screen-input = 1.

ENDIF.

ENDIF.

  • Modifying the screen after making changes

MODIFY SCREEN.

ENDLOOP.

Hope this helps.If so,reward points.Otherwise get back.

0 Kudos

hi jayanthi

I have created a db tabel and inserted data into it through dialog programming. what iam trying is to update the existing data in db table for which i created screens. On intial screen i have provided an input field( like vbeln). whn enterd, it will display the subsequent data ( eg netwr, zmeng, etc) in another screen and I also provided with three push buttons ( edit, save).

whn pressed 'edit' button...

The values of the screen should be in editable mode.

and after editing the values....

whn pressed 'save'

the values edited shuld replace the existing values in db table.

It will be grt if someone provides the code.

Regards

Madhu

0 Kudos

Hi,

Just declare a variable flg of type c.

Set it to 'X' if edit pressed is pressed in PAI.

MODULE user_command_9000 INPUT.

DATA :lv_fcode LIKE sy-ucomm, "Function Code

lv_answer(1) type c. "Storing the answer

lv_fcode = sy-ucomm.

CASE lv_fcode.

WHEN 'EDIT'.

flg = 'X'.

ENDCASE.

ENDMODULE. " USER_COMMAND_9000 INPUT

In PBO,

MODULE set_screen_fields OUTPUT.

LOOP AT SCREEN.

IF flg IS INITIAL.

screen-input = 0.

ELSE.

  • Making the screen field as editable.If this is not working give the field name specially like screen-name = 'I_MAKT-ZMAKTX'

screen-input = 1.

endif.

  • Modifying the screen after making changes

MODIFY SCREEN.

ENDLOOP.

ENDMODULE. " set_screen_fields OUTPUT

If you are using table control for your requirement,you can make your program efficient.

The similar thing I am handling in table control in this link.

Just have a look.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap code samples/table control in abap.pdf

If you have any doubt in that,get back to me.Kindly reward points if it is useful.

0 Kudos

Hi,

1) example for update in dialog:

case ok_code.
    WHEN 'SAVE'.
*calculate value
    netwr = inp-zmenge * inp-netpr.
*** Update Ztable
          UPDATE Z0001 SET zmenge = inp-zmenge
                           netpr  = inp-netpr
                           netwr  = netwr
                 WHERE vbeln = inp-vbeln
                  AND  matnr = inp-matnr.

          IF SY-SUBRC <> 0.
            ROLLBACK WORK.
            MESSAGE X001(00) WITH 'posting-error:' inp-vbeln.
          ENDIF.
          leave to screen 0.
...
endcase.

regards Andreas