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

whats is this coding means?

Former Member
0 Likes
1,158

Anyone know what the below code mean?

CONSTANTS: C_IT(20) TYPE C VALUE '(SAPLEBNE)BSN[]',

C_FIELD(20) TYPE C VALUE 'KUNNR'.

FIELD-SYMBOLS: <KUNNR> TYPE EBAN-KUNNR,

<IT> TYPE ANY TABLE,

<WA> TYPE ANY.

ASSIGN (C_IT) TO <IT>.

LOOP AT <IT> ASSIGNING <WA>.

ASSIGN COMPONENT C_FIELD OF STRUCTURE <WA> TO <KUNNR>.

CHECK SY-SUBRC = 0.

<KUNNR> = VBAK-KUNNR.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,024

Hi Justin

This is a way of indirectly reference to variables, work areas, internal tables of a different program.

Suppose we implementing a user-exit for a particular transaction. We might not have all the required variables used in the actual program, we can internally follow the above method to access the data declared in the original program.

Here SAPLEBNE is the program and BSN is the internal table the code is trying to access.

Internal table BSN can be found in include: LEBNETOP of program SAPLEBNE.

Program is related to Purchase Requistions.

Kind Regards

Eswar

Anyone know what the below code mean?

CONSTANTS: C_IT(20) TYPE C VALUE '(SAPLEBNE)BSN[]',

C_FIELD(20) TYPE C VALUE 'KUNNR'.

FIELD-SYMBOLS: <KUNNR> TYPE EBAN-KUNNR,

<IT> TYPE ANY TABLE,

<WA> TYPE ANY.

ASSIGN (C_IT) TO <IT>.

LOOP AT <IT> ASSIGNING <WA>.

ASSIGN COMPONENT C_FIELD OF STRUCTURE <WA> TO <KUNNR>.

CHECK SY-SUBRC = 0.

<KUNNR> = VBAK-KUNNR.

ENDLOOP.

6 REPLIES 6
Read only

Former Member
Read only

0 Likes
1,024

Thanks santosh..basically I am blur on this part...what it means?

CONSTANTS: C_IT(20) TYPE C VALUE '(SAPLEBNE)BSN[]',

ASSIGN (C_IT) TO <IT>.

LOOP AT <IT> ASSIGNING <WA>.

ASSIGN COMPONENT C_FIELD OF STRUCTURE <WA> TO <KUNNR>.

CHECK SY-SUBRC = 0.

<KUNNR> = VBAK-KUNNR.

ENDLOOP.

Whats is this part mean actually? '(SAPLEBNE)BSN[]'..calling a program??

Read only

Former Member
0 Likes
1,025

Hi Justin

This is a way of indirectly reference to variables, work areas, internal tables of a different program.

Suppose we implementing a user-exit for a particular transaction. We might not have all the required variables used in the actual program, we can internally follow the above method to access the data declared in the original program.

Here SAPLEBNE is the program and BSN is the internal table the code is trying to access.

Internal table BSN can be found in include: LEBNETOP of program SAPLEBNE.

Program is related to Purchase Requistions.

Kind Regards

Eswar

Read only

0 Likes
1,024

Hi Eswar,

I think I understand more from your explaination.

However I still have doubt.

When you mention about actual program and original program, whats is the different?

Actually I saw this code in SAPMV45A program which are create sales order program for VA01, VA02 and VA03. What you means is SAPLEBNE is reside in SAPMV45A program and we can use the BSN internal table in SAPMV45A?

By the way, I am not doubting you mentioned that SAPLEBNE is a PR program, can tell me how you found out that?

Read only

0 Likes
1,024

HI Justin

Glad could give you some idea.

Depending on business scenarios we can have link between SO & PR.

Eg: Third Party Sales: SO -> PR -> PO.

Coming to your point of finding out how "SAPLEBNE" is PR related program: I have just checked the code by going to SE38, it is Function Pool program. Double Click on include "LEBNEUXX" i.e Function Modules: we can find PR related FM's.

As you were saying, you have found the code in SAPMV45A, it might have invoked some FM's in SAPLEBNE activating/populating few variables/internal tables. So we have the data residing in memory which can be assessed after the call to FM is finished.

Hope the info helps some more for your understanding.

Kind Regards

Eswar

Read only

0 Likes
1,024

Thanks Eswar...i fully understand now