2014 Dec 15 1:05 PM
Hi Experts,
i have a requirement to pass data from class instance to variable but i am getting error in this below logic.
DATA: lo_rbitem TYPE REF TO cl_browser_item,
lo_al_ritem TYPE REF TO cl_gos_al_item,
g_value TYPE char10.
LOOP AT it_bitem INTO lo_rbitem.
lo_al_ritem ?= lo_rbitem.
g_value = lo_al_ritem->gs_lporb-instid.
SELECT SINGLE vbeln vbtyp vkorg spart vtweg
FROM vbak
INTO g_vbak
WHERE vbeln = g_value
AND vbtyp IN (A,C,K,L).
endloop.
Error :-
| Class CL_GOS_ATTACHMENTS,Method IF_CMD_HANDLER~EXECUTE_ITEMS_CMD | 51 |
| Field "GS_LPORB-INSTID" is unknown. It is neither in one of the |
| specified tables nor defined by a "DATA" statement. . |
Anybody can help me.
Thanks,
Ram.
Hi ,
As per your code, Try this code.
DATA: lo_rbitem TYPE REF TO cl_browser_item,
lo_al_ritem TYPE REF TO cl_gos_al_item,
g_value TYPE char10.
CREATE OBJECT lo_rbitem.
CREATE OBJECT lo_al_ritem.
LOOP AT it_bitem INTO lo_rbitem.
lo_al_ritem ?= lo_rbitem.
g_value = lo_al_ritem->gs_lporb-instid.
SELECT SINGLE vbeln vbtyp vkorg spart vtweg
FROM vbak
INTO g_vbak
WHERE vbeln = g_value
AND vbtyp IN (A,C,K,L).
endloop.
This may solve your issues.
Regards,
Ganesh Lathi
2014 Dec 15 1:23 PM
Hi Ram,
You have to add Create Object command, Before using any method.
Instantion of the class is missing .
Regards,
Ganesh
2014 Dec 15 2:20 PM
Hi Ganesh,
How can i add create object command, Can you guide me.
Thanks,
2014 Dec 15 2:30 PM
Hi ,
As per your code, Try this code.
DATA: lo_rbitem TYPE REF TO cl_browser_item,
lo_al_ritem TYPE REF TO cl_gos_al_item,
g_value TYPE char10.
CREATE OBJECT lo_rbitem.
CREATE OBJECT lo_al_ritem.
LOOP AT it_bitem INTO lo_rbitem.
lo_al_ritem ?= lo_rbitem.
g_value = lo_al_ritem->gs_lporb-instid.
SELECT SINGLE vbeln vbtyp vkorg spart vtweg
FROM vbak
INTO g_vbak
WHERE vbeln = g_value
AND vbtyp IN (A,C,K,L).
endloop.
This may solve your issues.
Regards,
Ganesh Lathi
2014 Dec 15 2:41 PM
Hello,
i assume you have in the importing table "it_bitem" of your method instances of the cl_browser_item, that's mean you don't need to "re" create them.
The problem is, that the member attribute "gs_lporb" which you trying to access, doesn't exists.
Where do you get this variable name?
BR
Hunor Czaka
2014 Dec 15 2:59 PM
Hi Czaka,
Yes i want this lo_al_ritem->gs_lporb-instid field data in my variable then i can pass in to vbak select query.Can u help me for this requirement.
Thanks,
2014 Dec 15 3:10 PM
Hello,
i understand what you are trying to do, but the problem is:
"lo_al_ritem" is a reference of the class CL_GOS_AL_ITEM
The class CL_GOS_AL_ITEM has no attribute called "gs_lporb".
That's why you couldn't access it.
The question is, where did you get this specific attribute name? You need to figure out, what exactly you need to do and where are the information's saved.
BR
Hunor Czaka
2014 Dec 16 5:54 AM
Hi Czaka,
yes that's correct in class CL_GOS_AL_ITEM attribute is not availabe name of "gs_lporb". but i refered to class lo_al_ritem TYPE REF TO cl_gos_al_item in this class that name of attribute is availabe but i am facing same error.
2014 Dec 16 8:30 AM
Hello,
you are writing the same class twice... please try to think about the problem a bit before asking. The field you want to access doesn't exists. That's the problem.
BR
Hunor Czaka
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |