cancel
Showing results for 
Search instead for 
Did you mean: 

How can I update from a screen that is call within a report program?

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Those are new data.

Can I update ztables on mini sap from a programm ?

Thank Deepak and Mart.

Help will be apriciated.

kind regards....

Fidel Peralta.

Former Member
0 Kudos

Sorry mate i have never used MiniSAP, not yet anyway, got the disk the other day just waiting to get windows XP so i can use it. Anyway back to your problem, can you add entries to the Z table using SE11, if so have you tryed the insert command to see if that makes any difference.

INSERT <dtab>

Former Member
0 Kudos

> 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

Former Member
0 Kudos

Do not Use Commit work Explicitly.

Former Member
0 Kudos

Can i just ask if an entry with the specific key already exists and you are updating it or if it is a new entry into the table.

Former Member
0 Kudos

Is a new entry.

can I use those commands on mini sap?

kind regards..

Fidel Peralta

Former Member
0 Kudos

thanks for the help Deepak.

Regards...

Fidel Peralta.

Former Member
0 Kudos

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