Application Development and Automation 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: 
Read only

Populating a custom table

Former Member
0 Likes
751

When Sales Order is created, using output determination I will be triggering a program. I need to write the program to fill in the Customer number, sales document number, date, time and set flag as blank into a table ZTABLE

Can anyone help me with the syntax

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
669


tables: ztable.

ztable-kunrr = kunnr.
ztable-vbeln = vbeln.
ztable-datum = sy-datum.
ztable-uzeit  = sy-uzeit.
ztable-flag   = space.
insert ztable.

Regards,

Rich Heilman

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
670


tables: ztable.

ztable-kunrr = kunnr.
ztable-vbeln = vbeln.
ztable-datum = sy-datum.
ztable-uzeit  = sy-uzeit.
ztable-flag   = space.
insert ztable.

Regards,

Rich Heilman

Read only

former_member194669
Active Contributor
0 Likes
669

Hi,

check for userexit on saving sales order.

MV45AFZZ.u can use USEREXIT_SAVE_DOCUMENT,USEREXIT_SAVE_DOCUMENT_PREPARE

write your code in this exit to update the Z table.

aRs

Read only

Former Member
0 Likes
669

Hi,

You can also use update statement.


update ztable
set kunnr = wa_kunnr
    vbeln = wa_vbeln
    datum = sy-datum
    uzeit = sy-uzeit
    flag  = space
where <condition>.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
669

So I have ZTABLE (KUNNR, VBELN, ERDAT,ERZET,FLAG)

Do I simply create a report?

REPORT ZREPORT.

TABLES: ZTABLE

KUNNR=VBAK-KUNNR.

VBELN=VBAK-VBELN.

ERDAT=NAST-ERDAT.

ERZET=NAST-ERUHR.

FLAG=SPACE.

INSERT ZTABLE.

Read only

Former Member
0 Likes
669

Hi,

In the userexit USEREXIT_SAVE_DOCUMENT in the include MV45AFZZ..Create an include..

IN the include have the following code..

tables: ztable.

ztable-kunrr = vbak-kunnr.

ztable-vbeln = vbak-vbeln.

ztable-datum = sy-datum.

ztable-uzeit = sy-uzeit.

ztable-flag = space.

MODIFY ztable.

Thanks,

Naren

Read only

former_member194669
Active Contributor
0 Likes
669

you can also use

DATA: wa TYPE ztable.

wa-id = '12400177'.

wa-name = 'Robinson'.

wa-postcode = '69542'.

wa-city = 'Heidelberg'.

wa-custtype = 'P'.

wa-discount = '003'.

wa-telephone = '06201/44889'.

MODIFY ztable FROM wa.

      • Inserts a new line or updates an existing line in a database table.

aRs