I created a screen to capture new data and save it on the ztables that i created, this screen is part of a report program that works as fallows:
(in a selection screen) if the customer exist will display a basic list with the info. of that customer.
if the customer dosen't exits, then i call the screen to create the customer. i'm stuck in that part. I don't know how to update the ztables from the screen.
can someone help me.
this is on mini sap 6.10
regards....
Fidel Peralta
Simply place the update code into the PAI section of the screen. One way would be to create a work area with the same structure as your table and within the PAI section of your screen populate this work area with your screen fields. Then use the modify command which i think is somthing like:
MODIFY <dbtab> FROM <work area>.
Hope this helps
> I created a screen to capture new data and save it on
> the ztables that i created, this screen is part of a
> report program that works as fallows:
> (in a selection screen) if the customer exist will
> l display a basic list with the info. of that
> customer.
> if the customer dosen't exits, then i call the
> screen to create the customer. i'm stuck in that
> part. I don't know how to update the ztables from the
> screen.
> can someone help me.
>
> this is on mini sap 6.10
> regards....
> Fidel Peralta
I still have problems when I am going to update the tables on my program.
This is the PAI of the screen to create new customers.
(in that screen i have fields of two different tables, zclient and zprestamo.)
If someone cant tell me what I am doing wrong in the
modify part I will appriciate it.
...thankz for the help Mart.
Fidel Peralta.
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'reset'.
LEAVE TO SCREEN 100.
WHEN 'save'.
<b>MOVE-CORRESPONDING: zscrprestamo TO wa_prestamo,
zscrprestamo TO wa_client.</b>
period = wa_prestamo-amount_borrow + (
wa_prestamo-amount_borrow * interes ) /
wa_prestamo-timetopay.
<b>TABLES zclient.
zclient-client_id = wa_client-client_id.
zclient-last_name = wa_client-last_name.
zclient-first_name = wa_client-first_name.
zclient-street = wa_client-street.
zclient-city = wa_client-city.
zclient-zipcode = wa_client-zipcode.
zclient-phone_number = wa_client-phone_number.
zclient-status = wa_client-status.
MODIFY zclient.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
ENDIF.</b>
<b>TABLES zprestamo.
zprestamo-amount_borrow = wa_prestamo-amount_borrow.
zprestamo-amount_to_pay = period.
zprestamo-timetopay = wa_prestamo-timetopay.
MODIFY zprestamo.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
ENDIF.</b>
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Add a comment