How do I read this "standard" table in my Function Module?
I have a remote-enable Function Module (RFC). I am receiving two tables as part of the parameters. Table "A" is header information, and Table "B" is detail information. So for every 1 "A" header record, I may have 1 to many "B" detail records. I have a field we'll call "vendor_number" that is the common link between the two tables.
Here's what I want to do: I want to loop through table "A", and for each record, I want to do a READ on table "B", using the "ref_doc_no" from "A" as my key, to get the position of the first matching record. I hold onto the value of the table index and then start looping table "B", adding 1 to the saved table index each time to process all of the detail records.
Here's the problem: This worked great as an ABAP program. I had my "B" table declared with "ref_doc_no" as a non-unique key. But when I ported my code over to the RFC, it told me that the RFC could only deal with standard tables. I had to remove the "ref_doc_no" key declaration. So now when I try to activate, I get an error similar to this:
The declaration for the key field "another_field" is incomplete; however, "another_field" is contained in the key of table "B" and must be filled.
I don't understand that. I've not declared any keys for table "B". I don't understand why it's thinking I need to populate "another_field" (I don't even know what the value would be). My code to read the table (i.e. the line getting the error) is this:
Priming read on table (sets the initial sy-tabix index value)
READ TABLE it_incoming_invoice_line_item "table 'B'
WITH TABLE KEY ref_doc_no =
wa_incoming_invoice_header-ref_doc_no
INTO wa_incoming_invoice_line_item.
Is it possible for me to do some sort of direct read on a table in an RFC? The only alternative I can think of would be to have to loop through table "B" until I find the first occurrence of a match. Is that what I need to do?
Thanks everyone. Points, as always, awarded for helpful answers.
Dave,
1. You can fire SELECTS in an RFC as well, but in your case the data exists in SYSTEM A and the RFC is in System B, so you can't do that. You can fire SELECTS on tables in the same system.
2. Quick example of two table loops - EKKO (HEADER) EKPO (ITEM).
LOOP AT EKKO.
LOOP AT EKPO WHERE EBELN = EKKO-EBELN.
ENDLOOP.
ENDLOOP.
I hope this is clear now.
Regards,
Ravi
Similar Messages
-
How to change records in standard tables ?
how to change records in standard tables ?
HI,
If you are asking from program..Then you can use BDC or BAPI to update the records in teh standard tables..
OR
use the corresponding tcode to update the record
Thanks
Naren -
How can i read this response?
i hav a encrypted string subsinfo, & i forward it to dec.jsp to be decrypted & it result :
HTTP_RESPONSE
msisdn|firstname|lastname
how can i read this response so i can have the parameter string newsubsinfo = msisdn|firstname|lastname ?Hi ,
You can read request parameters and store in a Container or Global container object and use them in response mapping as per requirement .
Use Container / Global container - you can save your parameters as key value pair and retrive it using the key and attach these parameters to response structure and access them .
Nanda -
How to put scrol bar in table viw control in module pool programming
how to put scrool bar in table-view control in module pool programming
Hi Rani,
You need not insert Scrollbar in the table control, it appears automcatically once the amount of data vertical or horizontal limit of table control.
Regards,
Sathish
Note : Reward useful Answers -
How to refer to the class in the regular function module
Hi ABAP guru's
I wish to get details of GET_REQUID parameter of method IF_RSBK_REQUEST_GENERAL that is available in
class CL_RSBK_REQUEST.
I am writing a ABAP function module and I wish to use this class in that function
module. Can someone help to write this code on how to read value of GET_REQUID in my function module?
Here is ny sample code which is not working--
l_r_request_main = cl_rsbk_request->N_REQUID
l_r_request = IF_RSBK_REQUEST_GENERAL->GET_REQUID( ).
catch cx_rs_not_found.
continue.
call method l_r_request->get_tstate
exporting
i_check_if_active = rs_c_true
receiving
r_tstate = l_tstate.
Thanks for your help in advance
AgHi anjali,
Tables are like multi line containers ,which can act as both import and export parameters .
means,the data in the table can be used by the function module during its execution and the same table can be populated with result after the fm execution .
you can also refer :http://help.sap.com/saphelp_erp60_sp/helpdata/en/d1/801ece454211d189710000e8322d00/content.htm
Regards,
Krishna. -
Add entries to database tables using update function module
Hi All,
I have a small requirement, in which I need to update Z-tables usimg update function module in update task. In the calling program, I have gathered the data in a field symbol value of type any. I need to pass the same to that function module to update the data which is in the field symbol.
Please guide me how to achieve this technically.
Thanks in advance,
Pradipta .Hi,
I believe you already have evrything with you.....Start Coding the same and come back with any Coding issue.
I believe you will not be able to pass the Field Symbol in FM Interface.....You need to pass the Variable which Field Symbol is referring.... -
Tables-Parameter in Function module
Hello together,
i created a new function module in CRM with one "Tables"-Parameter. The parameter will be filled in debugging but if i call the fm in SAPRFC test script the table is empty. Do have any idea how i could solve this?
Best regards
SaschaChanging parameters can be used as work areas as well as tables, tables can not be used as work areas.
Reference Difference between changing and table parameters in Function Modules SAP ABAP - Modularization techniques in SAP ABAP | at SAPNuts.com -
How to create Billing Plan in sales order using Function module /BAPI
hi,
How to create Billing Plan in sales order using Function module /BAPI
i hv check few FM such
BILLING_SCHEDULE_READ
BILLING_SCHEDULE_GET_NUMBER
BILLING_SCHEDULE_SAVE
But unable to create billing plan for a sales order.....any other method to create???Hi,
Use this link.
Create sales order with billing plan via LSMW and BAPI BUS2032
BAPI or Function to update Billing Plan in Sales Order Items
Hope this will help you.
Regards,
Vijay -
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 -
How to pass multi value selection parameter to SAP Function Module?
Hi ,
Anyone know how to pass CR multi value parameter - array to SAP Function module ?
eg multi selection of customer in CR
and then pass to Function module
in SAP FM, the SQL select these customer only
How should the import parameter / table of SAP Function module designed?
and how should CR pass the data to SAP FM
thx
JohnMoved to Integration Kit forum
-
Table Name or Function Module to find out all the Screens & Subscreens for
Hello Experts,
Table Name or Function Module to find out all the Screens & Subscreens for all T-Codes
Helpful Answer will b rewarded
Arif ShaikHi Balaji,
But TSTC only Gives the Program Name , T-Code and Screen but not all the Subscreen details
Any other which U know -
Reg : Table name of Functional Module
Can some one sent me the table name where functional module details get stored
HI,
Check for Function Module.
Tables
TFDIR----
> Table contains Function Modules.
TFTIT----
>Table contains Function Module Short Text.
ENLFDIR-----> Additional Attributes for Function Modules.
rewards if useful,
regards,
nazeer -
How to add value in standard table
Hi
i need to add one field in standard table VBAK so i have added one field ( for eg i have added status as field in VBAK ) in that standard table through append structure
than i used one user exit USEREXIT_SAVE_DOCUMENT_PREPARE in program MV45AFZZ
in this i get values in the structure XVBAK
than i moved the 'X' in that status field shown below
XVBAK-STATUS = 'X' .
after that sales order get generated
but when i open table VBAK and enter that VBELN or sales order no. i dont find any value in that status
so pls tell how can i find value of that field in table VBAK .
Thanks
Taranafter moving the value did u append the table.
Check it. -
How to Fetch Data From Standard Table MARA and Display using BOPF ?
Hello All,
In BOPF creation of Quey to a node fetches data from the Data Base Table attached to that Node,
But in my requirement I have to fetch data Present in a Standard table and Display it in the FPM List Using FBI.
** Can we Fetch the data From Standard Table and fill the Node in BOPF, Is this possible as the standard Table do not contain KEY field which BOPF uses for Data Fetching ?
Kindly share your Idea's .
Thanks in Adv.Hi Dhivya,
Thanks For your Response.
In my Requirement I want to make ROOT Node as Transient Node.
When I create a Sub Node to a Root Node, I am able to get this option to make this sub node as a Transient Node .
By selecting 'Standard<-->Extended' option in the Menu item 'GoTo' I am able to get this Transient Node check box field for the Sub Nodes.
I want to make a ROOT Node as a Transient Node.
(Which Version you are using, and which transaction you are using to create BO . we are using BOBX Transaction, Version Ehp 6 )
Kindly Guide me .
Thanks,
Kranthi Kumar. -
Hi there,
Just got this piece of code and I was wondering how can I read it...
Any help?
Thanks!Thanks
And what about .js files.. this piece of code is a bridge.js file and like in HTML, isn't it possible to trace where this connects to? I mean the tags...
<a href="http://s768.photobucket.com/albums/xx322/jmfer1/?action=view¤t=Capturadeec r-2012-04-07214924.png" target="_blank"><img src="http://i768.photobucket.com/albums/xx322/jmfer1/Capturadeecr-2012-04-07214924.pn g" border="0" alt="Photobucket"></a>
Maybe you are looking for
-
Affect of a new planning level selection
Hi, we have a BW-BPS environment with lots of BPS functionalities, palnning sequenses, save, copy functions... Until now we have all products from SAP R/3 extracted. Newly there are now in SAP R/3 lots of small products. Planning people donu2019t wan
-
Dual wireless/ Load Balancing/ Link Aggregation
Hi all, I've been reading up on this topic all day, with multiple Google and Apple searches, but haven't found the exact answer to this query. There was another post on this forum http://discussions.apple.com/thread.jspa?threadID=1660762 which was va
-
Starting and stop Oracle 9i database
Hello; Can anybody tell me how to start and stop an Oracle 9i database manually with Window NT 4 ? thanks a lot !
-
Logic 9, snow and project mix
I can make it crash at will all i have to do is work for a bit and go to file and boom, done i have to save using my key commands I also keep getting the error message syncing midi to external device no doubt maudio needs to update
-
Apply a Batch Process of Clean Up and Level Voice Over?
I want to apply a batch proces of "Clean Up and Level Voice Over," which is a preset. However, batch processes can only use "favorites." So I try to create a favorite with the preset. But this gives me an error, "A new favorite could not be recorded