2014 Mar 07 11:36 AM
Hi Everyone:
I have a situation like this.
eg:
types: begin of y_test,
include type vbak,
a type c,
b type c,
end of y_test.
data: wa_test type y_test.
now assuming wa_test is already populated i need to pass 2 parameters from wa_test to a Class method , lets say wa_test-vkorg and wa_test-vtweg .
How can i refer to the nested include inside y_test?
2014 Mar 07 11:56 AM
study this source in your own abap, hopefully, it will make you understand it better.
types: begin of y_test,
include type vbak,
a type c,
b type c,
end of y_test.
data: wa_test type y_test.
break-point. "check the value
wa_test-include-vbeln = '000000001'.
types: begin of y_test2.
include structure vbak.
types: a type c,
b type c,
end of y_test2.
data: wa_test2 type y_test2.
break-point."check the value
wa_test2-vbeln = '000000001'.
I personally prefer typing with structures/table types as of y_test2.It is syntactically easier and makes more sense as you work with the data and so on.
Cheers
Hi, Manish,
I probably do not understand the meaning of the points here. What can I buy for them? Or what advantage do I have once I earned enough?
2014 Mar 07 11:56 AM
study this source in your own abap, hopefully, it will make you understand it better.
types: begin of y_test,
include type vbak,
a type c,
b type c,
end of y_test.
data: wa_test type y_test.
break-point. "check the value
wa_test-include-vbeln = '000000001'.
types: begin of y_test2.
include structure vbak.
types: a type c,
b type c,
end of y_test2.
data: wa_test2 type y_test2.
break-point."check the value
wa_test2-vbeln = '000000001'.
I personally prefer typing with structures/table types as of y_test2.It is syntactically easier and makes more sense as you work with the data and so on.
Cheers
2014 Mar 07 12:12 PM
Thanks steve, you're right, and it works..it does make more sense as you're addressing the field just like you would do it in a regular type.
thanks... cheers
2014 Mar 07 1:20 PM
thanks - would of been nice of you to mark my answer as correct - as I spent the time to help!
Cheers & good luck with your solution!
2014 Mar 07 1:29 PM
It appears the thread is a discussion, not a question. Reply can't be marked correct.
2014 Mar 07 3:18 PM
Hi, Manish,
I probably do not understand the meaning of the points here. What can I buy for them? Or what advantage do I have once I earned enough?
2014 Mar 07 3:39 PM
Most forums have points/reps/karma system.
A feel-good factor. Something you can brag about. Nothing more than that.
2014 Mar 07 6:12 PM
How about putting them on your resume? That ought to count for something right?
It shows you been answering people's doubt and been really active in the SAP world.
2014 Mar 08 2:31 AM
You could just write that you contribute on SCN. Being a mentor/moderator counts. Points do not.
2014 Mar 07 12:09 PM
Hi Ramiwal,
You can do like this.
Since you have populated the WA_TEST and you need to pass wa_test-vkorg and wa_test-vtweg to the class method ok.
so the class method should have the importing parameters as VKORG and VTWEG.
For Instance :
ZCL_SALES_OPERATION->GET_DATA(
IMPORTING
IM_VKORG = WA_TEST-INCLUDE-VKORG
IM_CTWEG = WA_TEST-INCLUDE-VTWEG
) .
The above senaio will be used for your codee Since in the type declaration you are including the structure so now it is Nested Structure.
As Steve mentioned above if you include the fields in your structure you can use them directly.
For Instance :
ZCL_SALES_OPERATION->GET_DATA(
IMPORTING
IM_VKORG = WA_TEST-VKORG
IM_CTWEG = WA_TEST-VTWEG
) .
Regards,
Waliullah Mohd
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |