‎2012 Sep 21 9:24 AM
Hi everybody,
I'm trying to do a relationship between an idoc and a material document (MIGO 101 good receipt). I use this function to do it: BINARY_RELATION_CREATE
I've seen a interesting post in SCN:
http://scn.sap.com/thread/1470474
I did a sample program:
DATA: l_logsys TYPE logsys.
DATA: l_relationtype TYPE binreltyp.
DATA: obj_rolea TYPE borident.
DATA: obj_roleb TYPE borident.
* 2. Get own logical system
CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
IMPORTING
own_logical_system = l_logsys
EXCEPTIONS
own_logical_system_not_defined = 1
OTHERS = 2.
obj_rolea-objkey = 'XXXXXXXXXXXXXXXXXXX'.
obj_rolea-objtype = 'IDOC'.
obj_rolea-logsys = l_logsys.
CONCATENATE 'YYYYYYYYYY' '2012' INTO obj_roleb-objkey.
obj_roleb-objtype = 'BUS2017'.
obj_roleb-logsys = l_logsys.
l_relationtype = 'IDC0'.
* 3. Create link
CALL FUNCTION 'BINARY_RELATION_CREATE'
EXPORTING
obj_rolea = obj_rolea
obj_roleb = obj_roleb
relationtype = l_relationtype
* FIRE_EVENTS = 'X'
* IMPORTING
* BINREL =
* TABLES
* BINREL_ATTRIB =
EXCEPTIONS
no_model = 1
internal_error = 2
unknown = 3
OTHERS = 4.
commit WORK.
But it doesn't work, maybe because the l_relationtype(IDC0) isn't correct I think. objtype(BUS2017) isn't probably correct either. I don't Know. Somebody could help me with this issue?
Thanks in advance
best regards
‎2012 Sep 21 9:42 AM
I solved my issue.
If it will help you, the l_relationtype must be IDC1
Thanks
BR
‎2012 Sep 21 9:42 AM
I solved my issue.
If it will help you, the l_relationtype must be IDC1
Thanks
BR