SREL_GET_NEXT_RELATIONS
Hi, I found tutorial <i>Getting IDocs linked to Application documents (By Kevin Wilson)</i>
http://www.erpgenie.com/sapedi/idoc_abap.htm
and I try to use SREL_GET_NEXT_RELATIONS FModule to get IDOC number having accountancy document numbers generated by that IDOC (one of 4 generated by IDOC).
REPORT ZWOP_P10_TEST4 .
DATA: t_roles LIKE RELROLES OCCURS 0 WITH HEADER LINE.
DATA: t_object LIKE BORIDENT OCCURS 0 WITH HEADER LINE.
REFRESH: t_roles.
* VBRK = Invoice
* LIKP = Delivery
* BUS2032 = Sales Order
* BUS2035 = Scheduling Agreement
* objkey - Application document number appended with line if applicable
t_object-objkey = '5970122489'.
t_object-objtype = 'VBRK'.
APPEND t_object.
CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
EXPORTING
object = t_object
TABLES
roles = t_roles
EXCEPTIONS
internal_error = 1
no_logsys = 2
OTHERS = 3.
WRITE: ''.
returns empty t_roles What am I doing wrong? Please give me some tip. Greetings. P.
Hi Vinod,
can you tell your problem.
In ECC6 i use this method:
DATA: LS_LPOR TYPE SIBFLPORB,
LT_LPOR LIKE TABLE OF LS_LPOR,
LS_OPTION TYPE OBL_S_RELT,
LT_OPTION TYPE OBL_T_RELT,
LS_ROL_OP TYPE OBL_S_ROLT,
LT_ROL_OP TYPE OBL_T_ROLT,
LS_LINKS TYPE OBL_S_LINK,
LT_LINKS TYPE OBL_T_LINK.
LS_LPOR-INSTID = '000300000122'.
LS_LPOR-TYPEID = 'BUS2080'.
LS_LPOR-CATID = 'BO'.
APPEND LS_LPOR TO LT_LPOR.
Welche Attachments werden gesucht: Je nach gesetzten Attributen
LS_OPTION-SIGN = 'I'.
LS_OPTION-OPTION = 'EQ'.
LS_OPTION-LOW = 'ATTA'.
APPEND LS_OPTION TO LT_OPTION.
LS_OPTION-LOW = 'NOTE'.
APPEND LS_OPTION TO LT_OPTION.
LS_OPTION-LOW = 'URL '.
APPEND LS_OPTION TO LT_OPTION.
LS_ROL_OP-SIGN = 'I'.
LS_ROL_OP-OPTION = 'EQ'.
LS_ROL_OP-LOW = 'GOSAPPLOBJ'.
APPEND LS_ROL_OP TO LT_ROL_OP.
CALL METHOD CL_BINARY_RELATION=>READ_LINKS
EXPORTING
IS_OBJECT = LS_LPOR
IT_RELATION_OPTIONS = LT_OPTION
IT_ROLE_OPTIONS = LT_ROL_OP
IMPORTING
ET_LINKS = LT_LINKS.
Regards, Dieter
Similar Messages
-
READ_LINKS_OF_BINRELS instead of SREL_GET_NEXT_RELATIONS
I am updating a report from 4.7 to 5.0, and I learned that function module SREL_GET_NEXT_RELATIONS will not work for me in 5.0. I am trying to use cl_binary_relation=>read_links_of_binrels instead, and then call FM SO_OBJECT_READ.
In code for 4.7 I used SREL_GET_NEXT_RELATIONS, then mapped from resulting l_roles_tab-objkey to folder and object_id parameters of SO_OBJECT_READ. (See code below.)
How do I fill FOLDER and OBJECT_ID parameters of SO_OBJECT_READ with results of new method read_links_of_binrels instead of old function module SREL_GET_NEXT_RELATIONS?
Here is how I mapped the fields when using SREL_GET_NEXT_RELATIONS:
folder-objtp = wa_l_roles_tab-objkey+0(3).
folder-OBJYR = wa_l_roles_tab-objkey+3(2).
folder-OBJNO = wa_l_roles_tab-objkey+5(12).
object_id-objtp = wa_l_roles_tab-objkey+17(3).
object_id-OBJYR = wa_l_roles_tab-objkey+20(2).
object_id-OBJNO = wa_l_roles_tab-objkey+22(12).
owner = ' '.
filter = 'XX'.
CALL FUNCTION 'SO_OBJECT_READ'
EXPORTING
FILTER = filter
FOLDER_ID = folder
FORWARDER =
OBJECT_ID = object_id
OWNER = owner
F_MAILER = ' '
IMPORTING
OBJECT_FL_DISPLAY = OBJECT_FL_DISPLAY
OBJECT_HD_DISPLAY = OBJECT_HD_DISPLAY
OBJECT_RC_DISPLAY = OBJECT_RC_DISPLAY
Yes, I reward points!Hi,
I am sorry for the typing error. it will be
Here instid_b is nothing but objkey. Please check the structure SIBFLPORB.
document-foltp = i_links_s-instid_b+0(3).
document-folyr = i_links_s-instid_b+3(2).
document-folno = i_links_s-instid_b+5(12).
document-objtp = i_links_s-instid_b+17(3).
document-objyr = i_links_s-instid_b+20(2).
document-objno = i_links_s-instid_b+22(12).
folder_id-objtp = document-foltp.
folder_id-objyr = document-folyr.
folder_id-objno = document-folno.
move-corresponding document to object_id.
CALL FUNCTION 'SO_OBJECT_READ'
EXPORTING
FOLDER_ID = folder_id
OBJECT_ID = object_id
aRs
Message was edited by:
aRs -
SREL_GET_NEXT_RELATIONS parameters
Hi. I found a tutorial to IDOC modules. But I ca't discover which type are parameters.
REFRESH: t_roles.
* VBRK = Invoice
* LIKP = Delivery
* BUS2032 = Sales Order
* BUS2035 = Scheduling Agreement
* objkey - Application document number appended with line if applicable
t_object-objkey = itab_data-objky.
t_object-objtype = 'VBRK'.
CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
EXPORTING
object = t_object <= TYPE???
TABLES
roles = t_roles <= TYPE???
EXCEPTIONS
internal_error = 1
no_logsys = 2
OTHERS = 3.
LOOP AT t_roles WHERE objtype = 'IDOC'.
t_idoc_docnum = t_roles-objkey.
ENDLOOP.
*** Read the IDoc detail from the database
CALL FUNCTION 'IDOC_READ_COMPLETELY'
EXPORTING
document_number = p_docnum
IMPORTING
idoc_control = s_edidc <= TYPE??
TABLES
int_edidd = itab_edidd <= TYPE?
EXCEPTIONS
document_not_exist = 1
document_number_invalid = 2
OTHERS = 3.Hi,
Use SE37--> and enter the function module name --> use where used list. you can find what kind of types has been used for these function modules
a® -
Shipment document number and cost document number for vendor invoice
Hi,
Given a Vendor invoice number ( MIRO) how to find out the shipment number and cost docuemnt number?
Regards,
Krishna prasad.Hi,
Please try using SREL_GET_NEXT_RELATIONS. Please try to search on SDN and you should find an example fo this. The only thing you need to pass is the Business Object Name for Vendor Invoice number. Or if you have an alternal field like even PO that you can pass , that will be of great help as well.
You may want to take a look at:
SREL_DISPLAY_LIST_OF_NEIGHBORS
SREL_GET_NEXT_RELATIONS
Pls reward points if useful.
Thanks
Ganesh.S -
Hello,
I want to get the attachment list for a material. There are classes available to the attachemtn list as popup but I want to get this value in an internal table.
Can anyone help.
Thanks in advance
RameshHi,
I think you can use function module <b>SREL_GET_NEXT_RELATIONS</b>.
DATA : ls_object LIKE borident,
lt_links LIKE relgraphlk OCCURS 0 WITH HEADER LINE.
MOVE <your material number> TO ls_object-objkey.
MOVE 'BUS1001' TO ls_object-objtype. "BOR Type for Material
CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
EXPORTING
object = ls_object
roletype = 'APPLOBJ'
relationtype = 'OFFD'
* MAX_HOPS = 1
TABLES
links = lt_links
* ROLES =
EXCEPTIONS
internal_error = 1
no_logsys = 2
OTHERS = 3 .
Hope this helps..
Sri -
Get Idoc Number created through BD14
Hi,
I want to send some vendor details from SAP side to other system.And for that I am submitting BD14 using some vendor numberand message type cremas.
Now whenever we execute BD14 transaction with a vendor it will create one idoc number.
Now please let me know can we get this idoc number?
If i go to we02 i can see that but i want the table from where i can get this idoc number as i want show it in my final report output.
Edited by: Julius Bussche on Sep 12, 2008 4:45 PMHi
Its very simple.
Use function module SREL_GET_NEXT_RELATIONS
where :
GWA_OBJECT-OBJKEY = VENDOR_NUMBER.
GWA_OBJECT-OBJTYPE = 'LFA1'.
CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
EXPORTING
OBJECT = GWA_OBJECT
TABLES
ROLES = GT_ROLES .
DELETE GT_ROLES WHERE OBJKEY EQ VENDOR_NUMBER AND OBJTYPE EQ 'LFA1'.
After that, you will get IDOC number in the OBJKEY field where OBJTYPE = 'IDOC' -
Saving IDOC Number from control_record_out before IDOC goes out.
Hi,
How would I save the IDOC number so that I can maintain a table with
Idocnumber
Document Number
Date
Etc
The IDOC num is not populated until the system finally does save the idoc and send it? Right?
Need that IDOC number via an exit or something.
thanks.Use function SREL_GET_NEXT_RELATIONS to rather get the link after the IDOC has gone out.
Any better/easier ways?
regards -
Capturing Idocs created by BAPI Created Documents
Hi guys,
I have a big problem that i could really need some help, i use a BAPI:
BAPI_ACC_DOCUMENT_POST to create documents, in same cases depending on the accounts used there are some CO documents created and their equivalent idocs.
I searched everywhere but i didn't find any way to get the number of the idoc generated by the CO document that is created, does anyone have any suggestions on what to do ???
In regular Documents i use this Function:
SREL_GET_NEXT_RELATIONS
but in this case it doesn't work even after many trials !
I would really aprecciate the help !Hi
If you are trying to find the idoc number that created a document, there is a way you can find it out.
Note down the important field details of the document that would help you identify the idoc that created it.
Go to transaction WE05. Using the date range the document got posted, pull up a list of idocs.
Then click on the List Specific segment, put in the segment name of the idoc and click continue.
It will bring up a table of table. You can find the row that contains the field information you have and by that approach find the idoc that created the document.
Hope this helps
Deepa -
Extraction of document flow from CRM
Hi experts,
I am currently struggeling with a generic extractor that will load the document flow from CRM into BW. My problem is that the load takes too long, due to the number of links in the document flow. I use a SAP FM called SREL_GET_NEXT_RELATIONS to get the document links and it works fine. The problem occurs when a campaign is linked to a transaction, since the campaign at my client can have more than 10 000 transactions and those transactions is then linked to other transactions and so on. This makes extraction of the document flow very large and slow to load.
Is there any standard way of extracting the document flow that I am missing?
Does anyone have any experience regarding extracting the document flow from CRM and would like to share their knowledge?
Help are appreciated!
/Sebastianthere's a reason why SAP does not deliver extractors for things like this
sometimes you need to face the end users (or project managers) with the "impact" of their requests... who would ever be able to look at a document flow that contains 50 transactions each of which linked to 1000 (or more) campaigns again each of which linked to a couple of other transactions?
anyways, you should talk to some very experienced ABAPers if you really wish to continue with this request, rethink your approach or, what I would strongly suggest, rethink your initial request to get this into BI (if your not using web reporting, reporting on this will already crash in Excel versions 2003 and lower) -
I WANT IDOCs names OF related SRM & CRM
I WANT IDOCs names OF related SRM & CRM
Ex: in R / 3 WE HAVE matmas,cremas
In the same way I need IDOCS of both .send me
Thanks
SreenivasHi
<u>You can try transaction - WE09. Give the message type and all the details that you have. you will get the Idoc number.</u>
By GR you mean Goods Receipt. GRs are transferred through Idocs as well. We are using the basic type MBGMCR01 for transferring the GR to backend R/3 system. Confirmation process in SRM is like GR in R/3.There is another process in R/3 as order confirmation which is different than SRM system. Try using this FM 'SREL_GET_NEXT_RELATIONS' .This will give you Idoc number based on document details.This FM is used for Getting IDocs linked to Application documents.
There is no Idoc for this process.SRM uses XML format for Confirmation which is equivalent to Goods confirmation process in ERP system. If you are in position to tell what is your exact requirement with table in SRM system,i should be in position to help. There is a transaction called BBP_PD using which you can get the required table.
Just go to this transaction in SRM EASY Access Menu. Select Object Type as (Take F4 Help here)
for confirmation ,object type = BUS2203. You will get an interactive list and you can browse the list and in the last node ,you will get some table names which may be helpful.
Regards
- Atul -
What is Ale, Edi,IDoc tech for sap
Hi all,
What is Ale, Edi,IDoc tech for sap?
Thanks.hi deniz,
<b>ALE</b>
ALE
Triggering OB via Change Pointers:
When an application make a changes in any object an entry is made in CDHDR and CDPOS tables. When any change is made the SMD(Shared Master Data) Tool checks that ALE setting and create a change pointer in the BDCP table that will point to CDHDR table. A standard program RBDMIDOC is scheduled to run on a periodic basis to evaluate the change pointers for a message type and start the ALE process to distribute to the appropriate destinations. The program will read the table TBDME to determine the IDoc selection program it is MASTERIDOC_CREATE_SMD_MATMAS in the case of MATMAS.
Outbound Process:
When the stand-alone program or the Transaction(BD10) is run, it calls the Idoc
Selection program MASTERIDOC_CREATE_REQ_MATCOR in the case of MATMAS, which is hard coded in the program. The Idoc Selection program reads the master data and create a master Idoc and stores it in the memory. The function module then calls ALE layer by using another function module MASTER_IDOC_DISTRIBUTE which is invoked inside it. Then Idoc filtering, Segment filtering etc.. are done in the ALE layer.
To dispatch the Idoc to the destination system, the system reads the partner profile to determine the destination system. Then the sending system calls the function module INBOUND_IDOC_PROCESS asynchronously on the remote system and passes the Idoc via memory buffer.
Asynchronous Communication:
The data that is IDocs and the function module are stored in ARFCDATA and ARFCSSTATE tables. The function module ARFC_DEST_SHIP will transports data to target System and the program ARFC_EXCUTE will execute the stored function Module. If communication problem occurs RSARFCSE program is automatically scheduled., if successful, entries in the tables ARFCSSTATE and ARFCDATA will be deleted.
Inbound Process:
The INBOUND_IDOC_PROCESS program is triggered as a result of RFC from the Sending System, the Idoc to be sent is passed as parameter for the function module
In the partner profile if Process immediately is selected then RBDAPP01 program is executed. It will read the process code(MATM) from the Partner profile, which in turn invoke the function module IDOC_INPUT_MATMAS for MATMAS
Function module will call the corresponding SAP transaction using call transaction or uses direct programs to convert the Idoc to Application document .
In the table TBD51 there will be entries to find which option is used.
Transactions:
SALE - IMG ALE Configuration root
WE20 - Manually maintain partner profiles
BD64 - Maintain customer distribution model
BD71 - Distribute customer distribution model
SM59 - Create RFC Destinations
BDM5 - Consistency check (Transaction scenarios)
BD82 Generate Partner Profiles
BD61 Activate Change Pointers - Globally
BD50 Activate Change Pointer for Msg Type
BD52 Activate change pointer per change.doc object
BD59 Allocation object type -> IDOC type
BD56 Maintain IDOC Segment Filters
BD53 Reduction of Message Types
BD21 Select Change Pointer
BD87 Status Monitor for ALE Messages
SALE Display ALE Customizing WEDI - ALE IDoc Administration
WE60 - IDoc documentation
SARA - IDoc archiving (Object type IDOC)
WE47 - IDoc status maintenance
WE07 - IDoc statistics
BALE - ALE Distribution Administration
WE05 - IDoc overview
BD87 - Inbound IDoc reprocessing
BD88 - Outbound IDoc reprocessing
BDM2 - IDoc Trace
BDM7 - IDoc Audit Analysis
BD21 - Create IDocs from change pointers
SM58 - Schedule RFC Failures
<b>EDI</b>
EDI(Electronic Data Interchange )
RFC DESTINATION:
A logical name used to identify the remote system on which a function needs to be executed.
Partner Profile:
It defines the characteristics of data being exchanged with the business partner.
Partner Function:
Role of the partner Eg:Ship-to-party,bill-to-party,etc in EDI and in ALE legacy system or remote SAP system.
Partner type:
The type of your business partner .
EDI KU/LI
ALE -- LS.
Archiving:
-Need to archive the important transmitted document
-Created in SARA
-Assigned in WE20.
PartnerProfile Tips:
RSECHK07- Consistency check for Partner Profile.
If you want to modify partner profile; copy it and then modify. If you cant modify it , u have to delete it.
To move partner profile to production system choose Partner -> Transport
Port defintion:
It defines the medium through which data is exchanged between systems.
tRFC - Used by ALE
FILe - Used by EDI
R/2 system system port For R/2 system
Internet port - to connect with internet applications
It also depends on the receiving side. If the receiving subsystem accepts tRFC, EDI also can use tRFC.
Remote Function modules required by Subsystem to send status and inbound idoc to SAP:
Startrfc - Program to execute RFC enabled Fun.mod. in SAP
EDI_DATA_INCOMING - To send data as inbound
EDI_STATUS_INCOMING - To send status to SAP
RSPARAM - To know the gateway service of the SAP system.
Message Control:
Output controller
A service program for determining the output type
To generate and manage various outputs from an application and control their medium and timing of exchange.
To retransmit the document without duplicating it
Procedure:
A procedure defines a set of possible outputs for an application
There may be more than one procedure but only one can be active
Requirement field in procedure specifies the condition which the sales docu. should reach,for sending the sales order response.
Output type:
Defines the characteristics and attributes of the output.
Access Sequence :
Defines a sequence in which the business rules are checked using condition record of the condition table for proposing output type.
Sapfans Q & A
SREL_GET_NEXT_RELATIONS -
Function Module that will provide me the number of the document that was created by an IDoc
RLSUB020
Program which uses the above function module.
Upgradation problem
When the old version program is upgraded in to newer version(4.0b  4.6c) the SE38 editor wont allow u get thru the programs normally to get rid of this.
Solution:
EDIT > MODIFICATION OPERATIONS > SWITCH OFF ASSISTANT. Hit Enter on the subsequently shown Warnings window. You should now be able to maintain the code as before.
When transporting the dialog program sometimes the links may be missing in the testing and production area. To overcome just check u have properly save your all includes and other stuff in the same request if not, do so. Other options In ver 4.6c -> Within ABAP editor try utilities/Update navigation index
this fixes the links
ALE( Application Link Enabling )
Disk Mirroring:
Changes occurring in the database should reflected to another disk that maintains a mirror image of the main disks contents.
Replicas:
Maintaining redundant data across multiple systems.
ALE:
It provides distributed environment to integrate non-SAP systems
Provides guaranteed delivery of data regardless of network problem to application.
Logical system :
The systems involved in distributed environment are assigned a logical name which uniquely identifies a system in a distributed environment.
Data Mapping:
Conversion of a business document in IDoc format to an EDI format (and vice versa) which is performed in the subsystem.
Message Types:
Represents a business function
Technical structure is the IDoc type
Or can say an instance of IDoc.
<b>IDoc :</b>
They are containers used to exchange data between any two process.
It represents an IDoc type and IDoc data
IDoc type is structure and IDoc data is an instance of it.
<b>Pls reward if helpful.</b> -
Attachments: Read comments (Personal notes)
Hello everybody.
I need to extract the personal notes attached to an employee. I mean:
Go to PB30; insert a pernr; then you have a little icon just down the tick of the transactions bar; click on the arrow and then click on "List of attachments" (Or something like that... I´m using the spanish version). Now you get a list of the attachments and you can click on one of them and read it. I need that to write them down into a SmartForm, so I need to extract them with code.
I´ve been able to input them with SO_OBJECT_INSERT and BINARY_RELATION_CREATE but I´m not able to output them.
Thanks in advance for your help.Hi,
Please check the following method to get binary data from GOS
is_object-instid = v_bo_id.
is_object-typeid = v_botype.
is_object-catid = 'BO'.
try.
call method cl_binary_relation=>read_links_of_binrel
exporting
is_object = is_object
ip_relation = 'NOTE' " << I think it will NOTE or MESSAGE i am confused
importing
et_links = et_links.
then use
call function 'SREL_GET_NEXT_RELATIONS'
exporting
object = lo_is_object_a
ROLETYPE =
relationtype = p_reltyp
MAX_HOPS = 1
INCL_APPLRELS = ' '
EXCL_ROLES =
EXCL_RELATIONS =
tables
links = lt_links
ROLES =
APPLLINKS =
exceptions
internal_error = 1
no_logsys = 2
others = 3
if not worked then try
fm BDS_BUSINESSDOCUMENT_GET_TAB
and also check the following link.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap-SendingGOSattachmentstoanemailaddress&
aRs -
Hi,
Can some one tell me how to identify an iDOC number for an sales order in CRM.
Regards,
RajHi Praveen,
ITs very easy ....
Use function module
FM SREL_GET_NEXT_RELATIONS
logic :
L_R_OBJECT-OBJKEY = Likp-VBELN.
L_R_OBJECT-OBJTYPE = LIKP.
CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
EXPORTING
OBJECT = L_R_OBJECT
ROLETYPE =
RELATIONTYPE =
MAX_HOPS = 1
TABLES
LINKS =
ROLES = L_T_relROLES
EXCEPTIONS
INTERNAL_ERROR = 1
NO_LOGSYS = 2
OTHERS = 3
DELETE L_T_RELROLES WHERE OBJKEY EQ VBELN AND OBJTYPE EQ OBJTYPE.
After this in the L_T_RELROLES table u can find the idoc number in the field OBJKEY
Please check this.... its works and let me know if u need any further help.
......Patil -
Hi
My requirement is to download attachment for the CJ20n attached with each project.
I am using Functions SREL_GET_NEXT_RELATIONS
and then SO_DOCUMENT_READ_API1 to read the contents of the attachments.
there is a parameter object_content which returns the contents of the file.
For text file its returning the exact content and i can write the file using those contents.
But in case of PDF i don't know how to generate the file out of that content. because its not a simple text. I am working on 4.6C system from where i have to down load the file and upload it to ECC 6.0
Regards
NareshGot the solution.
Simply using Download function with the object_content. -
ACCESS OUTBOUND DELIVERY (VL02N) ATTACHMENT
Hi all,
I want to use function module 'SREL_GET_NEXT_RELATIONS' for accessing attachment of outbound delivery. wat should be the i/ps for the same
thanx
Deepak kumarok
Maybe you are looking for
-
I upgraded my old mac to snow lepord and now when i try to play music in my i tunes it says "file can not be located" but it still lists all of my music
-
I reinstalled my plug-ins into Photoshop CC (2014) on Mac OSX 10.9.4, and they are greyed out in the Filters menu. How do I get them to work? I have tried everything including repairing permissions.
-
IDisk has information not visible in iWeb
When I go to my Web Gallery to view, download, or upload, there is no problem. When I browse my site, or friends to, there is also no problem(by site I mean http://web.mac.com/[AppleID]). Normally, all information, if hosted with .Mac, made with iWeb
-
Create multiple dynamic control for each splistitem
Hi , I using SharePoint 2010 , in that am creating a custom visual webpart, to show in my home page. In that i need to show my custom list's listitems such as 'ID' and 'Title' as dynamically label controls in my page. When ever a new item added in
-
DropDown in Table using WD ABAP
Hi Gurus, I am trying to populate dynamic values in a dropdown. This dropdown is in a table on the form. My context design is: DataSource ( cardinality 1..1) --> TableNode ( cardinality 0..n) --> Drop_Down ( cardinality 1..n)