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: 

Populating a custom table

Former Member
0 Kudos

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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos


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

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos


tables: ztable.

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

Regards,

Rich Heilman

former_member194669
Active Contributor
0 Kudos

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

ferry_lianto
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

former_member194669
Active Contributor
0 Kudos

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