cancel
Showing results for 
Search instead for 
Did you mean: 

Meaning of this code

Former Member
0 Kudos
153

Dear Experts,

Can somebody please explain me the meaning of the following code? I understand most of it. But things like DOC_TO_LOOK- what does it do?

  • Pickup clearing document into internal table.

SELECT * FROM BSEG INTO TABLE ZCLEAR_DOC

WHERE BUKRS = FS_DTFIAR_3-BUKRS

AND BELNR = FS_DTFIAR_3-AUGBL

AND GJAHR = ZFISYEAR.

  • Calculate amount to clear by looking for residual items.

  • Find original invoice: Invoice reference or current item.

if FS_DTFIAR_3-REBZG = ''.

DOC_TO_LOOK = FS_DTFIAR_3-BELNR.

else.

DOC_TO_LOOK = FS_DTFIAR_3-REBZG.

endif

Thank you very much.

Accepted Solutions (1)

Accepted Solutions (1)

Ashwin
Active Contributor
0 Kudos

Hi!

the code you gave is not actually filling the REBZG but it is finding a document no for calculating the total amount for clearance.

and if for finding the correct document no...if the REBZG( the invoice no of the transaction) is not specifed in the transferstructure of the datasource ..it is using the document no of financial document which has this transaction, for clearance document.

hope it clears your problem.

with regards

ashwin

Answers (4)

Answers (4)

Ashwin
Active Contributor
0 Kudos

Hi!

i think ..you should look at where is this is declared... the code sample you gave here does not really help in knowing what is DOC_TO_LOOK . can you provide code where this is first used in your code.

with regards

ashwin

Former Member
0 Kudos

Thanks everybody. I appreciate your prompt replies.

THis code is actually from a User exit for data coming from R/3 to BW(EXIT_SAPLRSAP_001). I am trying to fugure out how the REBZG field is filledup if it is empty. The DOC_TO_LOOK has been defined as below in the datapart:

DATA: DOC_TO_LOOK like FS_DTFIAR_3-BELNR

Thanks a lot.

Former Member
0 Kudos

Hi Visu,

The in the customer exit, under the code for that specific DataSource, check the internal table c_t_data. This is the table which contains all extracted data and the structure is same as your extract structure. If you want to find how a field is populated, check the technical name of the field in extract strcture and search for that field in the code. You shd get a clue.

Regards,

Sree

Former Member
0 Kudos

hi,

...and paste paragraphs where this DOC_TO_LOOK is used later

Regards,

Andrzej

Former Member
0 Kudos

Hi Visu,

Can you look at the data declaration part of the code and find out ..It seems to be a parameter or a temp variable to hold a value..

Ashish.

Former Member
0 Kudos

Hi Visu,

DOC_TO_LOOK might be a parameter returned by a FM. Where is this code from?

Best regards,

Eugene