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

SD-Pricing Routines - Invoice Split

aabhas_wilmar
Contributor
0 Likes
836

Hi Experts,

I have written a routine which splits the invoices.

As n example, we have three deliveries:

Delv1

Delv2

Delv3

And, acording to the logic for split, all deliveries gets splitted into separate invoices... Inv1, Inv2, and Inv3.

But, in the logic, we also check the prior invoices created on the same day.

Previously created on the same date and prior dates invoices are available in VBRK, and we can check it there, but if in the same billing run, deliveries are splitted to three invoices, and we are currently in the routine for second invoice being created, how can I check if the Inv1 has been created, and its related data... because the Save has not completed yet, it doesnt go and sits into database, it must be in some structure during the billing run...

Regards,

Aabhas

Hi Experts,

I have written a routine which splits the invoices.

As n example, we have three deliveries:

Delv1

Delv2

Delv3

And, acording to the logic for split, all deliveries gets splitted into separate invoices... Inv1, Inv2, and Inv3.

But, in the logic, we also check the prior invoices created on the same day.

Previously created on the same date and prior dates invoices are available in VBRK, and we can check it there, but if in the same billing run, deliveries are splitted to three invoices, and we are currently in the routine for second invoice being created, how can I check if the Inv1 has been created, and its related data... because the Save has not completed yet, it doesnt go and sits into database, it must be in some structure during the billing run...

Regards,

Aabhas

4 REPLIES 4
Read only

aabhas_wilmar
Contributor
0 Likes
711

Hi Friends,

The issue has been resolved using following statements:

ASSIGN ('(SAPLV60A)XVBRK[]') TO <fs_vbrk>.

ASSIGN ('(SAPLV60A)XVBPA[]') TO <fs_vbpa>.

ASSIGN ('(SAPLV60A)XKOMV[]') TO <fs_komv>.

but I recieve GETWA_NOT_ASSIGNED runtime error in some cases, any clue?

Checking for sy-subrc as follows is still getting into the error:

ASSIGN ('(SAPLV60A)XVBRK[]') TO <fs_vbrk>. <-- Error occurs here

IF sy-subrc = 0.

...

ENDIF.

Let me know how the runtime error be avoided...

regards,

-Aabhas

Read only

0 Likes
711

Asbhas,

GETWA_NOT_ASSIGNED is generally occured when we not maintain fieldcat or some variable properly.please check once if any of field may be differ from their decleration.

Amit.

Read only

0 Likes
711

Thanks for the reply, Amit.

Yeah, in general, this error occurs whenever an access is made to an unassigned field-symbol...

But, i guess we can make a check if a field symbol is not assigned using:

IF sy-subrc = 0

ENDIF.

OR

IF <fs> IS ASSIGNED.

ENDIF.

But here the error occurs right at the moment it is trying to assign the field symbol... and throwing the run time error... instead of going to the IF check...

Any other clues, to avoid this runtime error?

Read only

aabhas_wilmar
Contributor
0 Likes
711

Problem solved.

Refer thread: for details.