Error in passing internal table as returning parameter
Hi
Im new to ABAP OO.
I declared a parameter ret_kna1 Returning Type KNA1.
Inside the method, I am retrieving data from table KNA1 into internal table and then I want return the interal table value.
But Im not able to assing the internal table for eg : code
method READ_CUSTOMER_LIST.
data: lt_kna1 type TABLE OF kna1,
wa_kna1 LIKE LINE OF lt_kna1.
data: lv_kunnr type kna1-kunnr,
lv_land1 type kna1-LAND1.
SELECT * FROM kna1
INTO TABLE lt_kna1
WHERE land1 eq lv_land1.
insert LINES OF lt_kna1 INTO TABLE ret_kna1.
endmethod.
when I try to activate the error says 'ret_kna1 is not an internal table "OCCURS n" specification is missing.
but I can not declare the internal table 'ret_kna1' once again in the code, as it already defined in the parameter as type KNA1.
please help me how to assign internal table values to the returing structur.
Are you passing it as an EXPORT parameter?
use and define it in the TABLES section of your function module as so:
*" IMPORTING
*" VALUE(INCLUDE_X_LEVELS) TYPE CHAR1 OPTIONAL
*" TABLES
*" I_SELECTED_OU STRUCTURE HRROOTOB
*" I_SELECTED_EE STRUCTURE OBJEC
*" E_VIP_EPM_DISTR STRUCTURE ZHR_VIP_EPM_DISTR
*" E_RETURN STRUCTURE BAPIRET1
That way you can pass value in the table (if needed) and then pass the table with your values based on your own logic
Similar Messages
-
How to pass internal table values to parameter
hi,
how to pass internal table values to parameter in selection screen.if is it possible means please sent codeings.
thanks.
stalin.hi,
tables : mara.
data : begin of itab_mara occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
end of itab_mara.
selection-screen : begin of block blk1 with frame title text-001.
parameters : p_matnr like mara-matnr.
selection-screen : end of block blk1.
select matnr ernam from mara into corresponding fields of itab_mara
where matnr = p_matnr.
loop at itab_mara.
write :/ itab_mara-matnr,
itab_mara-ernam.
endloop.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo -
Returning Internal Table as Returning Parameter of Method (by Value).
When you return an internal table as the returning parameter of a method, it is passed by value. I understand the concept of passing by value vs. passing by reference, but exactly what this means in this case is ambiguous.
1) It could mean that the entire table, including data, is copied from the local table in the method into the parameter provided by the calling code.
2) Alternatively, it could mean that only the pointer to the table is passed by value and the data is not literally copied from one place in memory to another. This would <b>not</b> be the same as passing by reference. For instance, I believe this is how object references are passed by value.
I want to know how it works, so that I know if there is an efficiency problem with returning a huge table. The returning parameter is wonderful for getter methods, and I prefer to use it over exporting parameters, but I have some concern about passing tables as returning parameters since I don't know how this works.
Can anyone either explain this, or at least make it clear to me whether or not there is an efficiency issue?
Thanks, in advance,
-ChrisThanks to those who tried to help me with this question, but I finally had to just figure it out on my own. I just realized today that there is a way to find the answer using the debugger's <i>Go To->Status Display->Memory Use</i> option. This shows how variables are stored in memory.
The answer:
First of all, if you set one internal table equal to another like:
i_tab1 = i_tab2.
or like:
i_tab1[] = i_tab2[].
both will simply set <i>i_tab1</i> to point to the same memory that <i>i_tab2</i> is using. It does <b>not</b> make a copy. Now, if you attempt to change <i>i_tab1</i>, with an <i>append</i> statement for instance, a copy of <i>i_tab2</i>'s memory is made <b>then</b>! The requested change to <i>i_tab1</i> is then applied to the copied data. <b>AHA!!!</b> This means that even if you think you are copying a table, you are not really doing it until it becomes necessary due to a divergence in values.
I specifically tested a returning parameter to see how memory is handled, and it is basically just like an '<i>=</i>' statment. No copy of the data is performed at first. The memory that is allocated for the local variable in the method is simply pointed to by the variable used in the calling code to recieve that value.
What if you then change the value in the calling code after the method has finished executing? The answer depends on the situation. If the value that you returned from the method is still being pointed to by another variable somewhere, then a copy is made when you attempt to change the returned table in the calling code, but if there is no longer another variable pointing to this memory, you can change the table in the calling program all you want without causing a copy in memory.
For instance, if you have a getter method that returns the value of an attribute, at first no copy will be made, but when you try to change the table in your calling code, a copy will be made then. However, if you just fill a local table in your getter method and return that table, there will never be a copy made, because the local variable that originally pointed to that memory expired when the method completed. That means that after the method completes, the only variable pointing to the allocated memory is the one in the calling code that recieved the returning value.
This is fantastic!! This behaives in a way that seems to provide maximum efficiency in most cases. Also, the table copies are <b>never</b> a waste, since they only happen upon changing of one of the table variables that point to the common memory, and in this case you would <b>want</b> to make a copy to avoid corrupting the other variable.
Also, even if you did return your table as an exporting parameter by reference, you would not gain any significant efficiency. There would still be no table copy if you don't change the returned table. Also, if you did change the returned table, you <b>would</b> still produce a table copy if there was another variable, like an attribute, still pointing to the memory that you set your exporting paramter from before.
The only situation that I can see resulting in a needless efficiency problem is if someone used a getter method to return the value of a table attribute, then changed the returned table in the calling program, and then used a setter method to set the whole table attribute equal to the changed table. This would be a waste, so maybe this should be accomplished in another way.
In conclusion, there is essentially no reason to hesitate returning a whole internal table as a returning parameter from a method call, even though it is pass by value.
Kudos to the ABAP development team for their good design! -
Error in passing internal table to smartform
I have created a structure type in the driver program as below.
tYPES : BEGIN OF gy_final,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
laeda TYPE mara-laeda,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
meins TYPE mara-meins,
lgort TYPE mard-lgort,
werks TYPE mard-werks,
END OF gy_final.
Then i created internal table and its work area of the above structure type as below
data: it_final type STANDARD TABLE OF gy_final,
wa_final type gy_final.
I fetched the records in to the internal table it_final.
Now i wanted to pass this in to smartform.
nasi
CALL FUNCTION 'fname'
EXPORTING
it1_final = it_final.
I have created a similar structure in DDIC and declared in the smartform
still it shows the error
The following syntax error occurred in program "/1BCDWB/SAPLSF00000239 " in
include "/1BCDWB/LSF00000239F01 " in
line 669:
""IT_FINAL" is neither specified under "TABLES" nor is it defined as an"
" internal table."
Please help me to sove this issue.In form interface -> go to tab TABLE then declare as IT1_FINAL LIKE <structure DDIC>.
And i think when call form it should:
CALL FUNCTION 'fname'
TABLES
it1_final = it_final.
Regards,
Edited by: Thien M. Pham on Sep 15, 2010 3:28 PM
Edited by: Thien M. Pham on Sep 15, 2010 3:29 PM
Edited by: Thien M. Pham on Sep 15, 2010 3:30 PM -
Error while passing internal table between methods at design time
Hi,
In a method (say method1 for eg) I have declared an internal table, IT_RANGE2 as:
DATA: IT_RANGE2 TYPE STANDARD TABLE OF ZTTRANGE
ZTTRANGE is a tabletype in SE11 and has a line type ZRANGE.
In this method, I am calling another method (method2)
WD_COMP_CONTROLLER->HOLD_DATA( CHANGING IT_RANGE = IT_RANGE2 ).
IT_RANGE has been declared as;
PARAMETER TYPE REFTO ASSOCIATED TYPE
IT_RANGE CHANGING ZTTRANGE.
I am getting an error: IT_RANGE2 is not type-compatible with formal parameter IT_RANGE.
Please help.
MIckchange it_range2 like this
DATA: IT_RANGE2 TYPE ZTTRANGE -
Pass internal tables in Export Parameters of Function Module
Hi
How to pass internal tables through export parametes of the calling function module. i
think i can pass it by reference ....
if so can anyone suggest how to do it?Hi,
You can Export values of an Internal table in two ways, by :
1) specifying in Tables tab
(Not recommended since it's an obsolete in ECC 6.0)
If used, will reduce the performance of the FM
Tables are always passed by reference
2) specifying in Exports tab.
The parameter should be a Table type (created in se11)
having a Line type that refers to the structure of the data.
Pass by Value is not used for Normal Function modules.
Used usually for RFC enabled FMs.
Cheers,
Remi -
Passing Internal table as parameter to a Method
Hi,
Can somebody tell me how to pass an Internal table as a parameter to a method?
Thanks in advance,
Best Regards,
Manishdata: itab1 type string occurs 0 with header line.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
exporting
FILENAME = 'C:\ftext.txt'
APPEND = 'X'
changing
DATA_TAB = <b>itab1[].</b>
Svetlin -
How to pass internal table to form routine..?
Gurus,
I am creating a custom Function module in which i have declared few perform statements and passing internal table to it..but when i declare the form it gives me error that the internal table is unknown...Can u please suggest me what am i doing wrong...
DATA: Begin of tb_set_values occurs 0.
include structure rgsb4.
DATA: End of tb_set_values.
PERFORM read_sets_with_values USING wa_setheader CHANGING tb_set_values[].
FORM read_sets_with_values USING value(rwa_setheader) LIKE setheader
CHANGING rtb_set_values LIKE tb_set_values[].
DATA: v_setid TYPE setid.
*DATA: Begin of rtb_set_values occurs 0.
include structure rgsb4.
*DATA: End of rtb_set_values.
CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
EXPORTING
SHORTNAME = rwa_setheader-setname
IMPORTING
NEW_SETID = v_setid.
CALL FUNCTION 'G_SET_GET_ALL_VALUES'
EXPORTING
SETNR = v_setid
TABLES
SET_VALUES = rtb_set_values.
ENDFORM.
What can be the error..please helpWell actually, I just tested it and it works fine as you have written it in my test program, so not sure what you are doing wrong. This was tested in NW 7.0
REPORT rich_0001.
DATA: setheader TYPE string.
DATA: wa_setheader TYPE string.
DATA: BEGIN OF tb_set_values OCCURS 0.
INCLUDE STRUCTURE t000. "<<-- Test with T000 instead "rgsb4.
DATA: END OF tb_set_values.
SELECT * INTO TABLE tb_set_values FROM t000.
PERFORM read_sets_with_values USING wa_setheader
CHANGING tb_set_values[].
*& Form read_sets_with_values
* text
* -->VALUE(RWA_SETHEADER) text
* -->RTB_SET_VALUES text
FORM read_sets_with_values USING value(rwa_setheader) LIKE setheader
CHANGING rtb_set_values LIKE tb_set_values[].
DATA: ls_set_values LIKE LINE OF rtb_set_values.
LOOP AT rtb_set_values INTO ls_set_values.
WRITE:/ ls_set_values.
ENDLOOP.
ENDFORM. "read_sets_with_values
Regards,
RIch Heilman -
How to pass internal table to method of class
Hi all,
I am new to abap objects, i want to pass one internal table to class.
i am trying in this way.
class c1 definition.
method get_material importing t_stpo type any table
exporting t_mast type any table.
endmethod.
endclass.
class c1 implementation.
method get_material.
select f1 f2 f3 from <tab> into table t_mast
for all entries in t_stpo
where stlnr = t_stpo-stlnr.
endmethod.
endclass.
ERROR:
"stlnr" is not available
if i use this way. its not giing error.
class c1 definition.
method get_material exporting t_mast type any table.
endmethod.
endclass.
class c1 implementation.
method get_material.
select f1 f2 f3 from <tab> into table t_mast
for all entries in it_stpo
where stlnr = it_stpo-stlnr.
endmethod.
endclass.
how to pass internal table with some specific reference may be using like or type <it_xxxx>
thanksTry this.
TYPES : BEGIN OF ty_stpo,
stlnr TYPE stpo-stlnr,
idnrk TYPE stpo-idnrk,
menge TYPE stpo-menge,
END OF ty_stpo,
BEGIN OF ty_mast,
matnr TYPE mast-matnr,
werks TYPE mast-werks,
stlnr TYPE mast-stlnr,
END OF ty_mast,
tt_stpo TYPE TABLE OF ty_stpo,
tt_mast TYPE TABLE OF ty_mast.
DATA : it_stpo TYPE tt_stpo,
it_mast TYPE tt_mast.
* CLASS c1 DEFINITION
CLASS c1 DEFINITION.
PUBLIC SECTION.
METHODS : get_bom_numbers EXPORTING ex_stpo type tt_stpo,
get_parent_material IMPORTING im_stpo TYPE tt_stpo
EXPORTING ex_mast TYPE tt_mast.
endclass.
* CLASS c1 IMPLEMENTATION
CLASS c1 IMPLEMENTATION.
METHOD get_bom_numbers.
ENDMETHOD. "get_bom_numbers
METHOD get_parent_material.
ENDMETHOD. "get_parent_material
START-OF-SELECTION.
DATA : obj TYPE REF TO c1.
CREATE OBJECT obj.
CALL METHOD obj->get_bom_numbers
IMPORTING
t_stpo = it_stpo.
CALL METHOD obj->get_parent_material
EXPORTING
im_stpo = it_stpo
IMPORTING
ex_mast = it_mast.
Regards,
Rich Heilman -
ABAP OO - Passing Internal Tables from Method to Method
I'm new to writing methods.
I have a need to build an internal table in METHOD1 and pass the internal table to METHOD2. I'm confused how to declare the table in 'Parameter' section of the METHOD2. I have specified the following:
Parameter = WTAB1
Type = Import
Pass value = blank
Optonal = Blank
Typing Method = Type
Associated type = ZSCIW and this is declared in DDIC as a data type with fields ZZLINE(72) and ZZPOS(4)
Default value = blank
METHOD1 (simplified example)
method METHOD1.
Table of individual words from source code
types: begin of wline,
WORD(72),
POSN(4),
end of wline,
wlines type standard table of wline with default key.
data: wx type wlines,
wa like line of wx.
Clear past results
REFRESH: Wx.
Look through source code...
LOOP AT ref_include->lines into wa.
APPEND wa.
ENDLOOP.
Call METHOD2 and pass internal table wa
METHOD2 ( ).
1. How to you define the parameters in METHOD2.
2. What is the coding in METHOD1 to call METHOD2.
Your help will really be appreciated.
Thanks.
SoyabFor funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
Check these links.
http://www.henrikfrank.dk/abapuk.html
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
Go through the below links,
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
OO ABAP links:
1) http://www.erpgenie.com/sap/abap/OO/index.htm
2) http://help.sap.com/saphelp_nw04/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
go through these links
http://www.erpgenie.com/abap/index.htm
http://sic.fh-lu.de/sic/bic.nsf/(vJobangebote)/EC8AD2AE0349CE92C12572200026FDB8/$File/Intern%20or%20Working%20Student%20as%20ABAB%20OO%20Developer.pdf?Open
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/41341147041806e10000000a1553f6/frameset.htm
http://help.sap.com/saphelp_47x200/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
ABAP_OBJECTS_ENJOY_0 Template for Solutions of ABAP Object Enjoy Course
ABAP_OBJECTS_ENJOY_1 Model Solution 1: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_2 Model Solution 2: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_3 Model Solution 3: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_4 Model Solution 4: ABAP Objects Enjoy Course
ABAP_OBJECTS_ENJOY_5 Model Solution 5: ABAP Objects Enjoy Course
DEMO_ABAP_OBJECTS Complete Demonstration for ABAP Objects
DEMO_ABAP_OBJECTS_CONTROLS GUI Controls on Screen
DEMO_ABAP_OBJECTS_EVENTS Demonstration of Events in ABAP Objects
DEMO_ABAP_OBJECTS_GENERAL ABAP Objects Demonstration
DEMO_ABAP_OBJECTS_INTERFACES Demonstration of Interfaces in ABAP Objects
DEMO_ABAP_OBJECTS_METHODS Demonstration of Methods in ABAP Objects
DEMO_ABAP_OBJECTS_SPLIT_SCREEN Splitter Control on Screen
check the below links lot of info and examples r there
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
Check this cool weblog:
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
/people/thomas.jung3/blog/2004/12/08/abap-persistent-classes-coding-without-sql
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b6254f411d194a60000e8353423/frameset.htm
For funtion module to class
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5954f411d194a60000e8353423/content.htm
for classes
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b5c54f411d194a60000e8353423/content.htm
for methods
http://help.sap.com/saphelp_47x200/helpdata/en/08/d27c03b81011d194f60000e8353423/content.htm
for inheritance
http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm
for interfaces
http://help.sap.com/saphelp_47x200/helpdata/en/c3/225b6254f411d194a60000e8353423/content.htm
For Materials:
1) http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf -- Page no: 1291
2) http://esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
3) http://esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
4) http://esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
5) http://esnips.com/doc/92be4457-1b6e-4061-92e5-8e4b3a6e3239/Object-Oriented-ABAP.ppt
6) http://esnips.com/doc/448e8302-68b1-4046-9fef-8fa8808caee0/abap-objects-by-helen.pdf
7) http://esnips.com/doc/39fdc647-1aed-4b40-a476-4d3042b6ec28/class_builder.ppt
8) http://www.amazon.com/gp/explorer/0201750805/2/ref=pd_lpo_ase/102-9378020-8749710?ie=UTF8
<b>good book on ABAP objects(OOPS)
http://www.esnips.com/doc/bc475662-82d6-4412-9083-28a7e7f1ce09/Abap-Objects---An-Introduction-To-Programming-Sap-Applications</b>
Rewards if useful..............
Minal -
Client proxy.. passing internal table to output.
Hi friends,
I have created a proxy-JDBC scnario..
For this i created a datatype with 2 fields..
DT_Proxy_Outbound as complex type and 2 elements..and after that i have created a proxy class
ZCO_MI_PROXY_OUTBOUND (Proxy class)
ZMT_PROXY_OUTBOUND(structure)
and i have writen a code in abap report to pass data to output parameter..
but output parameter is of line type not a table type...
so it is taking onley one value but not entire internal table to output parameter.
i am including mycode here.
REPORT ZTEST_ABAP_PROXY.
DATA PRXY TYPE REF TO ZCO_MI_PROXY_OUTBOUND.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
ERNAM LIKE MARA-ERNAM,
END OF I_MARA.
CREATE OBJECT PRXY.
DATA IT TYPE ZMT_PROXY_OUTBOUND OCCURS 0 WITH HEADER LINE.
TRY.
SELECT MATNR ERNAM INTO TABLE I_MARA FROM MARA UP TO 10 ROWS.
LOOP AT I_MARA.
IT-MT_PROXY_OUTBOUND-MATNR = I_MARA-MATNR.
IT-MT_PROXY_OUTBOUND-ERNAM = I_MARA-ERNAM.
APPEND IT.
ENDLOOP.
CALL METHOD PRXY->EXECUTE_ASYNCHRONOUS
EXPORTING
OUTPUT = IT.
COMMIT WORK.
CATCH CX_AI_SYSTEM_FAULT .
DATA FAULT TYPE REF TO CX_AI_SYSTEM_FAULT .
CREATE OBJECT FAULT.
WRITE :/ FAULT->ERRORTEXT.
ENDTRY.
where should i change structure so that output can accept total internal table rather than line item.
Thnaks and Regards
VijayHi Vijay,
Try using the following code. I have used the variable ZDT_PROXY_OUTBOUND_TAB , which should appear in the zproxy transaction. The name may not be exactly correct, so please check and change accordingly. Check parameters of execute- asynchronous method. double click on associated type of output (ZMT..). You will get controller and Message type MT...Click on component type - ZDT.., you will get controller and a recordset( the name you have mentioned in your data type sender side). The corresponding component type would be the table ZDT_PROXY_OUTBOUND_TAB. Hope you understand and change accordingly.
REPORT ZTEST_ABAP_PROXY.
TABLES : MARA.
DATA PRXY TYPE REF TO ZCO_MI_PROXY_OUTBOUND.
DATA: BEGIN OF I_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
ERNAM LIKE MARA-ERNAM,
END OF I_MARA.
DATA : REC_OUTPUT TYPE ZDT_PROXY_OUTBOUND_TAB,
WA_REC_OUTPUT LIKE LINE OF REC_OUTPUT,
MARA_OUTPUT TYPE ZMT_PROXY_OUTBOUND.
CREATE OBJECT PRXY.
TRY.
SELECT MATNR ERNAM INTO TABLE I_MARA FROM MARA UP TO 10 ROWS.
LOOP AT I_MARA.
WA_REC_OUTPUT-MATNR = I_MARA-MATNR.
WA_REC_OUTPUT-ERNAM = I_MARA-ERNAM.
INSERT WA_REC_OUTPUT INTO TABLE REC_OUTPUT.
CLEAR : WA_REC_OUTPUT, I_MARA.
ENDLOOP.
MARA_OUTPUT-MT_PROXY_OUTBOUND-RECORDSET = REC_OUTPUT.
CALL METHOD PRXY->EXECUTE_ASYNCHRONOUS
EXPORTING
OUTPUT = MARA_OUTPUT.
COMMIT WORK.
CATCH CX_AI_SYSTEM_FAULT .
DATA FAULT TYPE REF TO CX_AI_SYSTEM_FAULT .
CREATE OBJECT FAULT.
WRITE :/ FAULT->ERRORTEXT.
ENDTRY.
-Regards,
Shamly -
Passing internal tables dynamically to a subroutine
Hi All,
How to pass internal tables dynamically to a subroutine?
In subroutine logic i'm fetching data from MARA table for all entries in the internal table passed to the subroutine. Based on some condition the internal table varies. I'm placing the code below
Both GT_AUFM & GT_AUFM1 are of 2 different structures having MATNR.
IF WA_AUFM1-BWART EQ '261'.
PERFORM GET_IF_SEMIFINISHED USING GT_AUFM1.
ELSE IF WA_AUFM1-BWART EQ '262'.
PERFORM GET_IF_SEMIFINISHED TABLES GT_AUFM.
ENDIF.
FORM GET_IF_SEMIFINISHED USING P_TABLE TYPE ANY TABLE.
REFRESH GT_MARA.
SELECT MATNR FROM MARA INTO TABLE GT_MARA
FOR ALL ENTRIES IN P_TABLE
WHERE MATNR EQ P_TABLE-MATNR
AND MTART IN R_MTART.
ENDFORM.
With this logic i'm getting an error that the specified type has no structure and therefore no component called MATNR.
Thanks,
Anil.refer this link
dynamic internal table -
Passing Internal tables to Workflow
Hello all,
I learning workflow and have a small doubt related to passing internal table as parameter to workflow when it is triggered by a report program explicitely.
I wrote a prog to upload data from flat file into internal table and by passing this ITAB to the workflow for futher processing. <b>Actually i succeeded in this with only one field in my flat file (lfa1-lifnr).</b>
<b>what if my flat file contains more than one field? (i.e., lifnr, name1, city, county) how should i declare the parameters for my EVENT (triggering event) and same with my container declaration?</b>
Any inputs in this regards are welcome.
Thank you in advance,
Lakshmi NarayanaHi Lakshmi,
Create Workflow container
swc_container lt_container.
swc_create_container lt_container.
Fill internal table with data
The container type and the internal table type should be same, U can use a structure to define both.
Declare a structure with all the fields.
Define a conatiner of same type of structure in worklow and set it in <b>wait for event</b> setp.
swc_set_table lt_container '<container_name>' lit_int_data.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = lc_objtyp
objkey = lv_objkey
event = lc_event
IMPORTING
event_id = lv_eventid
TABLES
event_container = lt_container
EXCEPTIONS
objtype_not_found = 1
OTHERS = 2.
Rgds,
Prakash
Message was edited by: Prakashsingh Mehra -
Dear Experts.
I have the following problem.
I am using a User-Exit for Travel that is called from a program standard with use the T.Code TRIP. The program standard use a structure that when entry in the user exit not is. I need use this structure in the user exit. (p_t_req_head).
I had read abour SAP and ABAP Memory but from the program standar How can Pass Internal Table to Memory SAP or ABAP from the program standard to user-exit?
When I am doing debugging in the program Standard and this call to the user exit, I use ()namestructure for example ()p_t_req_head and I get the datas of the structure, But In the Source Code ABAP, How can do this with instructions?
RegardsHi,
You try with Import & Export Statements as follows ---
DATA : t_itab LIKE TABLE OF spfli.
EXPORT t_itab TO MEMORY ID 'ABCD'.
After sending the internal table to ABAP memory you need to get that by IMPORT in the called session.
IMPORT t_itab FROM MEMORY ID 'ABCD'. -
Can we pass Internal tables to workflow container?
workflow container has a size limitation, we need to pass any infotype to the workflow container, so can we pass internal tables to workflow container or is there any alternate solution?
Thanks in Advance
HariHi,
Check the <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/a6/9bac935f2c11d194a40000e82dec10/frameset.htm">Multiline Container Element Definition.</a>
Regards
<i><b>Raja Sekhar</b></i>
Maybe you are looking for
-
Trouble with 30" HD Cinema Display using Mini DisplayPort to DVI Adapter
I bought a new MacBook Pro and I am having trouble getting the full resolution to work with my 30" HD Cinema Display (purchased in 2007 max resolution 2560 x 1600) using a Mini DisplayPort to DVI Adapter. According to the specs page, http://support.a
-
Adobe Reader plug-in for Safari can't find Adobe Reader
I keep Adobe Reader.app in Applications/Local-A/PDF Software. When I try to open a PDF in Safari (5.0.3), the plug-in can't find the reader. I have to point it there each time I open Safari. I would have thought it would know where to look after t
-
Issue in Infoview Schedulers after SP2 installation
Hi All, After the installation of SP2 on XIR3 (12.1.0.882.BOE_Mira_RTM), I am facing issue while scheduling webi reports from infoview. Under the u201CFormats and Destinationsu201D option, by default u201CWeb Intellegenceu201D is selected in output f
-
HT2105 is there a limit on redeeming gift cards per day? how about purchasing in app?
is there a limit on redeeming gift cards per day? how about purchasing in app?
-
Dear Sap Experts I try to call VBscript with SM49 that sends mail and I get this Error: MIcrosoft VBScript runtime error: error in loading DLL: 'objEmail.Configuration.Field.... The script is: I copy the script from: http://www.paulsadowski.com/WSH