Dynamic/generic Table in RFC module
Hi All,
Need to Implement parallel processing as large amount of data is involved using RFC function modules. Not able to do so as RFC is not allowing generic data type needed for passing dynamic internal tables.
Data is in internal tables formed dynamically & this data is to be processed. How this can be done.
how to implement parallel processing using dynamic internal tables using RFC type of module.
Thanks
Prat
Hi,
If it's RFC or not it shouldn't be a problem for passing generic data types to FM. I've just wrote and tested this code and it works. I'm using here static type (lyv_msg) but you could as well use dynamic.
TYPES lyv_msg(12) TYPE c.
data lv_msg TYPE REF TO DATA.
FIELD-SYMBOLS <fs_msg> TYPE ANY.
CREATE DATA lv_msg TYPE lyv_msg.
ASSIGN lv_msg->* TO <fs_msg>.
<fs_msg> = 'Some info'.
CALL FUNCTION 'TH_POPUP' DESTINATION 'NONE'
EXPORTING
CLIENT = 100
USER = 'USER'
MESSAGE = <fs_msg>
EXCEPTIONS
USER_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
Best regards
Marcin Choelwczuk
Similar Messages
-
Dynamic Internal Table in Function Module
Hi,
I am developing a function module which is similar to GUI_DOWNLOAD. So , In My function module I would like to pass the internal table dynamically.I saw the paramter DATA_TAB in the function module GUI_DOWNLOAD. But there is no type associated with that. Could anyone help Me out for achieving thsi fucntionality.
Regards
Elini.PHi Elini,
When the tables parameter of the function module has got no line type specified, it will acquire the same type as the parameter that is passed to it during the call. In other words, the table is of generic type. you can pass any table to that parameter.
However, in case your function module is Remote Enabled, you will not be able to define the tables parameter as generic. IOt must be given some line type.
Regards,
Anand Mandalika. -
Passing dynamic table to function module
Hi all,
actully i have to pass dynamic internal table from function module.
for that i use syntax
move <dyn_table> to data_tab.
but now my question is that in fm parameters what is the type spec & associated type for data_tab in fm parameters.
regards,
anujHi
Good
Here is a simple example of passing an internal table "itab" to a function module "REUSE_ALV_LIST_DISPALY".
It displays the internal table data into a list format.
data : itab like ztest213 occurs 0 with header line.
tables : ztest213 .
select * from ztest213 into table itab.
loop at itab.
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_structure_name = 'ztest213'
IS_LAYOUT =
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = itab
exceptions
program_error = 1
others = 2
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
Thanks
mrutyun^ -
Automatic creation of data base table and RFC through Programming
Hi All ,
I have an urgent requirement in which i will be given a Table design(Having parameter names and its type length etc) in xml format or in excel sheet , then by using that as an input i have to create it in Backend automatically through my coding. Can anyone tell me that how this can be done.
Another requirement like upper one is that if i have to automatically generate code for a Function Module on the basis of its signature given . then how this can be done.
Thanks & Regards,
Abhishek Bajpai
mailid --> [email protected]
Edited by: ABHISHEK BAJPAI on Dec 21, 2007 8:10 AMHello Abhishek
Have a look at thread: [DYNAMIC DDIC TABLE|DYNAMIC DDIC TABLE;
The function module you are looking for is FUNCTION_STUB_GENERATE.
Regards,
Uwe -
hi,
I wrote one source code in RFC which gives output as dynamic table.
I want this dynamics table as output of RFC.
In RFC, Table parameter does not support TYPE u2018ANYu2019 to define Table as Dynamic.
During runtime, RFC Code supposed to identify and fill columns.
I want to provide output of this RFC to webservice.
Regards
Mohinder Singhhi
If your FM is RFC enabled you can't declare a generic type. that is the problem when you try to use the FM and try to pass a dynamic table name to get the data from the remote system. or you can check
Check these FM 's: RFC_READ_TABLE
RFC_GET_TABLE_ENTRIES
hope this will help
regards
Prashant -
Passing dynamic internal table to FM using RFC
Dear All,
Is it possible to pass a dynamic internal table to a function module using RFC?
If it is possible than how do i achive this?Basically not, RFC enabled FM parameters must be defined by a LIKE or TYPE clause. so you may try to use a prededined SAP type wide enough (e.g. TAB512 ) and map the data in the FM and caller program (in Unicode try to use tools like class CL_ABAP_CONTAINER_UTILITIES to map data between actual internal table record and RFC used itab "container" type)
For examples look at RFC enabled RFC_GET_TABLE_ENTRIES FM, and look for where-used program.
Regards,
Raymond -
Dynamic Export table of a function Module
Hi Friends,
I have a requirement where fields of Export table of my function Module is dynamic. It is like the Fields to be expoerted by the Function Module would be stored in a seperate Z table
The Z table would contain the records as follows .
Table Name FieldName
=========
MARA MATNR
MARC WERKS
and So on..
. How can I define my Export table in Function module dynamically so that the structure of my Export Function Module would be same as that of the Fieldnames in Z table..
ThanksJust declare the associate type as "ANY TABLE" in the exporting parameter.
FUNCTION ZTEST.
*"*"Local Interface:
*" EXPORTING
*" REFERENCE(IT_TAB) TYPE ANY TABLE -
Dear all
I like to create a dynamic table in a RFC function and pass this table to the calling programm. Is this possible?
HerbertHi,
check the Below FM to create Dynamic table in RFC function ..
RFC_READ_TABLE -- External access to R/3 tables via RFC
RFC_GET_TABLE_ENTRIES -- Read table entries
Prabhu -
Dynamic Table Selection function module
Dear Friends,
We have got critical requirement on Custom BAPI function module :
we have to pass one field name of table and table name : Eg (Matnr and MARC).
we have to get table contents w.r.t field name of table and table : Has to display MARC based on Matnr.
(It is something like we display table contents in SE11 and SE16, Our requirement is to get the data by giving random field name of table and table name ).
My View : Imports Tab of F.M of is static
Tables Tab of F.M could be dynamic....if so how to achieve or any other approach?
Note : Eg1 : Matnr and MARA (Input to F.M) -
> Get MARA contents (Table from F.M)
Eg2 : Matnr and MARC (Input to F.M) -
> Get MARC contents (Table from F.M)
Eg3 : Lifnr and LFA1 (Input to F.M) -
> Get LFA1 contents (Table from F.M)
Eg1 : Ebeln and EKKO (Input to F.M) -
> Get EKKO contents (Table from F.M)
Awaiting for positive and quick views.
Regards
SekharDear Sarcevic,
I have created zfunction module with imports and tables.
I'm able to manage import parameters as dynamical, but tables declaration gives fuzzy.
How do we make tables tab declaration in function module as dynamic? any other views?
Regards
Sekhar -
Any docs regarding Table/View,Function Module for Generic Extraction
Hello All
I need to do Generic Extraction,for that if anyone has docs., I need docs on how to create table,view,Function module and infoset query ,on that pl forward to my id
[email protected]
Many Thanks
balajihi Amit
Thanks for your docs,but this docs i have already,do u have any thing different one,if so please forward?
Facing a Problem
Iam trying to create view(database view)for <b>vbak</b> and <b>vbap</b> and given in Tables in <b>Table/Join Conditions</b> tab and clicked in <b>Relationship</b> and the relantionship has been generated automatically,now when i tried to activate this view its saying like "<b>No tables and/or fields are defined for view xxxxx</b>(xxxx-> name of a view)
what will be the problem?pl let me know how to create a view?
And also I need to know the diffference between database view,Manintenance view,Projection view and help view?
Pl let me know on this?
Many Thanks
balaji -
Which RFC module/s should I use to access BW tables?
Hello,
I am in a proccess of creating an adaptive RFC model in Web Dynpro.
I am in a stage where I need to select my RFC modules.
My requirement is to access our BW tables.
I see many BAPI's and functions under the SAP Business Information Warehous tree. Which one should I use for needs?
RoyHi Roy,
You should use BI SDK for Java to connect to BW from Web Dynpro (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how%20to%20use%20the%20bi%20java%20sdk%20in%20a%20web%20dynpro%20application.pdf)
http://help.sap.com/saphelp_nw04/helpdata/en/6e/011e681cf74ab4b3acf73f77653405/frameset.htm
https://media.sdn.sap.com/public/html/submitted_docs/BW/BI_SDK_JavaDocs/bi_sdk_doc/docs/documentation.html
/people/moya.watson/blog/2004/04/05/the-bi-java-sdk-whats-in-it-for-you
/people/moya.watson/blog/2004/12/27/three-new-how-to-guides-for-the-bi-java-sdk
Best regards, Maksim Rashchynski. -
Which RFC module/s should I use to access DSO tables?
Hello,
I am in a proccess of creating an adaptive RFC model in Web Dynpro.
I am in a stage where I need to select my RFC modules.
My requirement is to access our DSO tbles.
I see many BAPI's and functions under the SAP Business Information Warehous tree. Which one should I use for needs?
RoyHi Roy,
You should use BI SDK for Java to connect to BW from Web Dynpro (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/how%20to%20use%20the%20bi%20java%20sdk%20in%20a%20web%20dynpro%20application.pdf)
http://help.sap.com/saphelp_nw04/helpdata/en/6e/011e681cf74ab4b3acf73f77653405/frameset.htm
https://media.sdn.sap.com/public/html/submitted_docs/BW/BI_SDK_JavaDocs/bi_sdk_doc/docs/documentation.html
/people/moya.watson/blog/2004/04/05/the-bi-java-sdk-whats-in-it-for-you
/people/moya.watson/blog/2004/12/27/three-new-how-to-guides-for-the-bi-java-sdk
Best regards, Maksim Rashchynski. -
Updating table in RFC enabled function module
Hi Experts,
I have written a RFC enabled FM in ECC which will accept a table through TABLES parameter in which two columns will be filled and will update the rest two columns. I am using modify statement to update table from work area. When I am calling this FM from APO system, I am not receiving the updated table back. I am passing table with two columns filled in each row and I am getting back as it was passed. Please let me know how to get modified table from RFC enabled FM.
Thanks in advance!Hi Nabheet, Code block is given below and calling is explained in other replys I made. I am not updating any database tables.
TYPES: BEGIN OF lty_marc,
matnr TYPE matnr,
werks TYPE werks,
mmsta TYPE dismm,
END OF lty_marc.
TYPES: BEGIN OF lty_marm,
matnr TYPE matnr,
umrez TYPE umrez,
END OF lty_marm.
DATA: lt_marc TYPE STANDARD TABLE OF lty_marc,
lt_marm TYPE STANDARD TABLE OF lty_marm,
lx_marc TYPE lty_marc,
lx_marm TYPE lty_marm,
lx_materials TYPE zmpts_snp_mat.
FIELD-SYMBOLS: <st_materials> LIKE LINE OF ct_materials.
BREAK NAGMAN02.
IF ct_materials IS NOT INITIAL.
SELECT matnr
werks
mmsta
INTO TABLE lt_marc
FROM marc
FOR ALL ENTRIES IN ct_materials
WHERE matnr = ct_materials-matnr
AND werks = ct_materials-werks.
SELECT matnr
umrez
INTO TABLE lt_marm
FROM marm
FOR ALL ENTRIES IN ct_materials
WHERE matnr = ct_materials-matnr.
LOOP AT ct_materials ASSIGNING <st_materials>.
READ TABLE lt_marc
INTO lx_marc
WITH KEY matnr = <st_materials>-matnr"lx_materials-matnr
werks = <st_materials>-werks."lx_materials-werks.
<st_materials>-mmsta = lx_marc-mmsta.
READ TABLE lt_marm
INTO lx_marm
WITH KEY matnr = <st_materials>-matnr."lx_materials-matnr.
<st_materials>-umrez = lx_marm-umrez.
ENDLOOP.
ENDIF. -
How to do parallel processing with dynamic internal table
Hi All,
I need to implement parallel processing that involves dynamically created internal tables. I tried doing so using RFC function modules (using starting new task and other such methods) but didn't get success this requires RFC enabled function modules and at the same time RFC enabled function modules do not allow generic data type (STANDARD TABLE) which is needed for passing dynamic internal tables. My exact requirement is as follows:
1. I've large chunk of data in two internal tables, one of them is formed dynamically and hence it's structure is not known at the time of coding.
2. This data has to be processed together to generate another internal table, whose structure is pre-defined. But this data processing is taking very long time as the number of records are close to a million.
3. I need to divide the dynamic internal table into (say) 1000 records each and pass to a function module and submit it to run in another task. Many such tasks will be executed in parallel.
4. The function module running in parallel can insert the processed data into a database table and the main program can access it from there.
Unfortunately, due to the limitation of not allowing generic data types in RFC, I'm unable to do this. Does anyone has any idea how to implement parallel processing using dynamic internal tables in these type of conditions.
Any help will be highly appreciated.
Thanks and regards,
Ashintry the below code...
DATA: w_subrc TYPE sy-subrc.
DATA: w_infty(5) TYPE c.
data: w_string type string.
FIELD-SYMBOLS: <f1> TYPE table.
FIELD-SYMBOLS: <f1_wa> TYPE ANY.
DATA: ref_tab TYPE REF TO data.
CONCATENATE 'P' infty INTO w_infty.
CREATE DATA ref_tab TYPE STANDARD TABLE OF (w_infty).
ASSIGN ref_tab->* TO <f1>.
* Create dynamic work area
CREATE DATA ref_tab TYPE (w_infty).
ASSIGN ref_tab->* TO <f1_wa>.
IF begda IS INITIAL.
begda = '18000101'.
ENDIF.
IF endda IS INITIAL.
endda = '99991231'.
ENDIF.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = pernr
infty = infty
begda = '18000101'
endda = '99991231'
IMPORTING
subrc = w_subrc
TABLES
infty_tab = <f1>
EXCEPTIONS
infty_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
subrc = w_subrc.
ELSE.
ENDIF. -
Delta fo Generic extractor using function module
Hi,
I am using the following function module for generic extractor but its always showing me extraction error.Could anyone please suggest to resolve the issue.
Thanks in advance fo rsuggestion.
FUNCTION Z_BW_SALESDATA_EXTRACT_CHNG2.
""Local interface:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SBIWA_S_INTERFACE-REQUNR
*" VALUE(I_ISOURCE) TYPE SBIWA_S_INTERFACE-ISOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SBIWA_S_INTERFACE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SBIWA_S_INTERFACE-INITFLAG OPTIONAL
*" VALUE(I_UPDMODE) TYPE SBIWA_S_INTERFACE-UPDMODE OPTIONAL
*" VALUE(I_DATAPAKID) TYPE SBIWA_S_INTERFACE-DATAPAKID OPTIONAL
*" VALUE(I_PRIVATE_MODE) OPTIONAL
*" VALUE(I_CALLMODE) LIKE ROARCHD200-CALLMODE OPTIONAL
*" VALUE(I_REMOTE_CALL) TYPE SBIWA_FLAG DEFAULT SBIWA_C_FLAG_OFF
*" TABLES
*" I_T_SELECT TYPE SBIWA_T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SBIWA_T_FIELDS OPTIONAL
*" E_T_DATA OPTIONAL
*" E_T_SOURCE_STRUCTURE_NAME OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER
The input parameter I_DATAPAKID is not supported yet !
Example: InfoSource containing TADIR objects
TABLES: VBFA,VBRK,tadir.
Auxiliary Selection criteria structure
DATA: l_s_select TYPE sbiwa_s_select.
Maximum number of lines for DB table
STATICS: l_maxsize TYPE sbiwa_s_interface-maxsize.
user defined variables.
DATA : X_UPDMODE(1) Type c, " Update Type
X_LastUpdate Like Sy-Datum. " Last Update Date
X_LastUpdate TYPE RODELTAID. " Last Update Date "TCS_KAP
Select ranges
RANGES: L_R_VBELN FOR VBAK-VBELN,
L_R_AUDAT FOR VBAK-AUDAT.
Parameter I_PRIVATE_MODE:
Some applications might want to use this function module for other
purposes as well (e.g. data supply for OLTP reporting tools). If the
processing logic has to be different in this case, use the optional
parameter I_PRIVATE_MODE (not supplied by BIW !) to distinguish
between BIW calls (I_PRIVATE_MODE = SPACE) and other calls
(I_PRIVATE_MODE = X).
If the message handling has to be different as well, define Your own
messaging macro which interprets parameter I_PRIVATE_MODE. When
called by BIW, it should use the LOG_WRITE macro, otherwise do what
You want.
Initialization mode (first call by SAPI) or data transfer mode
(following calls) ?
IF i_initflag = sbiwa_c_flag_on.
Initialization: check input parameters
buffer input parameters
prepare data selection
The input parameter I_DATAPAKID is not supported yet !
Invalid second initialization call -> error exit
IF NOT g_flag_interface_initialized IS INITIAL.
IF 1 = 2. MESSAGE e008(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'008' "message number
' ' "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDIF.
Check InfoSource validity
CASE i_isource.
WHEN 'Z_BW_SDDATA_CREATEON'.
WHEN 'Y'.
WHEN 'Z'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e009(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'009' "message number
i_isource "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
Check for supported update mode
CASE i_updmode.
WHEN 'F'.
WHEN OTHERS.
IF 1 = 2. MESSAGE e011(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'011' "message number
i_updmode "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDCASE.
Check for obligatory selection criteria
READ TABLE i_t_select INTO l_s_select WITH KEY fieldnm = 'VBELN'.
IF sy-subrc <> 0.
IF 1 = 2. MESSAGE e010(r3). ENDIF.
log_write 'E' "message type
'R3' "message class
'010' "message number
'PGMID' "message variable 1
' '. "message variable 2
RAISE error_passed_to_mess_handler.
ENDIF.
APPEND LINES OF i_t_select TO g_t_select.
Fill parameter buffer for data extraction calls
g_s_interface-requnr = i_requnr.
g_s_interface-isource = i_isource.
g_s_interface-maxsize = i_maxsize.
g_s_interface-initflag = i_initflag.
g_s_interface-updmode = i_updmode.
g_s_interface-datapakid = i_datapakid.
g_flag_interface_initialized = sbiwa_c_flag_on.
Store Update mode in static variable...
X_UPDMODE = I_UPDMODE.
Select Single DELTAID
Into X_LastUpdate
From ROOSGENDLM
Where OLTPSOURCE = 'Z_BW_SDDATA_CREATEON'.
If X_LastUpdate Is Initial.
X_LastUpdate = '19800101'. " The oldest..., this should not happen
Endif.
Fill field list table for an optimized select statement
(in case that there is no 1:1 relation between InfoSource fields
and database table fields this may be far from beeing trivial)
APPEND LINES OF i_t_fields TO g_t_segfields.
ELSE. "Initialization mode or data extraction ?
Data transfer: First Call OPEN CURSOR + FETCH
Following Calls FETCH only
X_UPDMODE = I_UPDMODE.
First data package -> OPEN CURSOR
IF g_counter_datapakid = 0.
Fill range tables for fixed InfoSources. In the case of generated
InfoSources, the usage of a dynamical SELECT statement might be
more reasonable. BIW will only pass down simple selection criteria
of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'VBELN'.
MOVE-CORRESPONDING l_s_select TO L_R_VBELN.
APPEND L_R_VBELN.
ENDLOOP.
LOOP AT g_t_select INTO l_s_select WHERE fieldnm = 'AUDAT'.
MOVE-CORRESPONDING l_s_select TO L_R_AUDAT.
APPEND L_R_AUDAT.
ENDLOOP.
Determine number of database records to be read per FETCH statement
from input parameter I_MAXSIZE. If there is a one to one relation
between InfoSource table lines and database entries, this is trivial.
In other cases, it may be impossible and some estimated value has to
be determined.
*added by Yogesh
DELETE FROM ZBWSALEDATA.
*ended by Yogesh
l_maxsize = g_s_interface-maxsize.
Check for supported update mode
CASE X_UPDMODE.
WHEN 'F' Or 'I'. " Full or Init
**get sales orders
SELECT *
INTO CORRESPONDING FIELDS OF TABLE I_SALESDATA
FROM VBAK AS K
INNER JOIN VBAP AS P
ON PVBELN = KVBELN
WHERE K~VBELN IN L_R_VBELN
AND K~AUDAT IN L_R_AUDAT
AND K~VBTYP = 'C'.
IF I_SALESDATA[] IS NOT INITIAL.
PERFORM F_GET_DATA. "get data
PERFORM F_DEL_VATCOND. "delete vat conditions
PERFORM F_GET_TAR_COSTUNIT. "get tariff cost unit
PERFORM F_GET_NETVAL TABLES IT_VBDPA1. "get net val of the item
PERFORM F_GET_SALESDATA.
*write perform with name F_INSERT_DB_ZBWSALEDATA.
PERFORM F_INSERT_DB_ZBWSALEDATA. "insert into table ZBWSALESDATA
LOOP AT I_SALESDATA WHERE NETPR = 0.
MOVE-CORRESPONDING I_SALESDATA TO I_SALESDATA_FIN.
APPEND I_SALESDATA_FIN.
ENDLOOP.
SORT I_SALESDATA_FIN BY VBELN POSNR KSCHL.
DELETE ADJACENT DUPLICATES FROM I_SALESDATA_FIN
COMPARING VBELN POSNR
KSCHL.
INSERT ZBWSALEDATA FROM TABLE I_SALESDATA_FIN.
ENDIF.
WHEN 'D'. " Delta
SELECT *
INTO CORRESPONDING FIELDS OF TABLE I_SALESDATA
FROM VBAK AS K
INNER JOIN VBAP AS P
ON PVBELN = KVBELN
WHERE K~ERDAT >= X_LastUpdate
WHERE K~ERDAT >= X_LastUpdate+0(8) "TCS_KAP
AND K~VBTYP = 'C'.
IF I_SALESDATA[] IS NOT INITIAL.
PERFORM F_GET_DATA. "get data
PERFORM F_DEL_VATCOND. "delete vat conditions
PERFORM F_GET_TAR_COSTUNIT. "get tariff cost unit
PERFORM F_GET_NETVAL TABLES IT_VBDPA1. "get net val of the item
PERFORM F_GET_SALESDATA.
*write perform with name F_INSERT_DB_ZBWSALEDATA.
PERFORM F_INSERT_DB_ZBWSALEDATA. "insert into table ZBWSALESDATA
LOOP AT I_SALESDATA WHERE NETPR = 0.
MOVE-CORRESPONDING I_SALESDATA TO I_SALESDATA_FIN.
APPEND I_SALESDATA_FIN.
ENDLOOP.
SORT I_SALESDATA_FIN BY VBELN POSNR KSCHL.
DELETE ADJACENT DUPLICATES FROM I_SALESDATA_FIN
COMPARING VBELN POSNR
KSCHL.
INSERT ZBWSALEDATA FROM TABLE I_SALESDATA_FIN.
ENDIF.
WHEN OTHERS.
IF 1 = 2. MESSAGE E011(R3). ENDIF.
LOG_WRITE 'E' "message type
'R3' "message class
'011' "message number
I_UPDMODE "message variable 1
' '. "message variable 2
RAISE ERROR_PASSED_TO_MESS_HANDLER.
ENDCASE.
**end get sales orders
OPEN CURSOR WITH HOLD g_cursor FOR
SELECT (g_t_fields) FROM ZBWSALEDATA.
WHERE pgmid IN l_r_pgmid AND
object IN l_r_object.
ENDIF. "First data package ?
Fetch records into interface table. There are two different options:
- fixed interface table structure for fixed InfoSources have to be
named E_T_'Name of assigned source structure in table ROIS'.
- for generating applications like LIS and CO-PA, the generic table
E_T_DATA has to be used.
Only one of these interface types should be implemented in one API !
FETCH NEXT CURSOR g_cursor
APPENDING CORRESPONDING FIELDS
OF TABLE E_T_DATA
PACKAGE SIZE l_maxsize.
IF sy-subrc <> 0.
CLOSE CURSOR g_cursor.
RAISE no_more_data.
ENDIF.
g_counter_datapakid = g_counter_datapakid + 1.
ENDIF. "Initialization mode or data extraction ?
Best regards,
YogeshDear Yogesh,
Try to debug the code by putting a break point at select statement...is the FM Syntactically correct ??
Check the Select statements..if all fields are not required avoid using Select * , and use always for all entries rather than JOINS..
Note : For Joins you have to specify the Fields in the Select...Dont use Select * ....
Hope it helps..
Thanks,
Krish
Maybe you are looking for
-
Any way to remove the prompt after Skype for Business patch?
So we rolled out the latest patches to our test machines and everyone got the new Skype for Business upgrade. When each person logged in they were greeted with a window that said something like: "Your administrator is set for you to use the Lync Use
-
pls let me know .........
-
Cannot get text file to print in jtable. Using text file as a database
Instead of doing JDBC i am using text file as database. I cant get data from text file to print into JTable when i click find button. Goal is to find a record and print that record only, but for now i am trying to print all the records. Once i get th
-
Standard report for Request for down payment
Dear All, Is there any standard report on request for down payment in case of vendor and Custm
-
Qosmio G10: How to get Toshiba Virtual Sound in Taskbar
System: Qosmio G10 running Windows XP. When I bought the system, it came loaded with Toshiba's 'Virtual Sound' app, which replaced the standard Microsoft Volume Control app in the XP Taskbar (bottom right of screen). Now, the standard 'Volume Control