2010 Feb 08 11:11 AM
Hi colleagues,
I am facing one problem and I would appreciate your help and ideas. I want to enable user to use a functionality of "Services for object" in creation mode (in my case transaction IW31). In change or display mode this functionality is enabled, so creating new BOR object and such things are not necessary.
I understand that services for object are disabled by default in creation mode, because it is not meaningful to assign some documents to object which does not yet exist. But in theoretical way, it should be possible to implement some "tricky" solution. Probably some temporary object could be created at the start of IW31 and attachments could be assigned to this object. And in some user exit executed during processing of save statement (after all checks and such things), attachments could be re-assigned to a real (persistent) object. For unsaved orders it would be necessary to delete temporary object and also attached documents.
Have someone implemented something similar? Or any helpful ideas?
Thank you all in advance.
Regards,
Adrian
2010 Feb 08 11:49 AM
Hi,
We have implemented exactly the same in a Ztransaction. Not sure to what extent this will help you. Check below code
CREATE OBJECT w_gosman
EXPORTING
* io_container = io_container
* is_bc_object = is_bc_object
is_object = wa_object "BOR object
* it_service_selection =
* io_callback = io_callback
* ip_start_direct = space
ip_no_instance = l_inst "Pass SPACE in your case
ip_no_commit = l_commit "Pass SPACE in your case
ip_mode = c_e
EXCEPTIONS
object_invalid = 1
callback_invalid = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
"Here just we are creating a reference by publishing the object.
"During the transaction commit call below method.
wa_object-objkey = "Pass your object ID.
wa_object-objtyp = "Pass your business object
CALL METHOD w_gosman->set_id_of_published_object
EXPORTING
* is_bc_object = is_object
is_object = wa_object
EXCEPTIONS
no_publication = 1
OTHERS = 2
.
COMMIT WORK.
Thanks,
Vinod.
Hi colleagues,
I am facing one problem and I would appreciate your help and ideas. I want to enable user to use a functionality of "Services for object" in creation mode (in my case transaction IW31). In change or display mode this functionality is enabled, so creating new BOR object and such things are not necessary.
I understand that services for object are disabled by default in creation mode, because it is not meaningful to assign some documents to object which does not yet exist. But in theoretical way, it should be possible to implement some "tricky" solution. Probably some temporary object could be created at the start of IW31 and attachments could be assigned to this object. And in some user exit executed during processing of save statement (after all checks and such things), attachments could be re-assigned to a real (persistent) object. For unsaved orders it would be necessary to delete temporary object and also attached documents.
Have someone implemented something similar? Or any helpful ideas?
Thank you all in advance.
Regards,
Adrian
2010 Feb 08 11:49 AM
Hi,
We have implemented exactly the same in a Ztransaction. Not sure to what extent this will help you. Check below code
CREATE OBJECT w_gosman
EXPORTING
* io_container = io_container
* is_bc_object = is_bc_object
is_object = wa_object "BOR object
* it_service_selection =
* io_callback = io_callback
* ip_start_direct = space
ip_no_instance = l_inst "Pass SPACE in your case
ip_no_commit = l_commit "Pass SPACE in your case
ip_mode = c_e
EXCEPTIONS
object_invalid = 1
callback_invalid = 2
OTHERS = 3
.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
"Here just we are creating a reference by publishing the object.
"During the transaction commit call below method.
wa_object-objkey = "Pass your object ID.
wa_object-objtyp = "Pass your business object
CALL METHOD w_gosman->set_id_of_published_object
EXPORTING
* is_bc_object = is_object
is_object = wa_object
EXCEPTIONS
no_publication = 1
OTHERS = 2
.
COMMIT WORK.
Thanks,
Vinod.
2010 Feb 08 11:55 AM
Hi,
the services for objects does not have any link with the current document operation. it acts independentally. it takes only the BO name and the key from the document operation. At the time of creation the key is not available so its blocked. if you are ready to make the document as prenumbered, it will appear in creation mode also. Services for objects can be called from anywhere using the existing function modules. so if you want you can create a small utility for your purpose.Moreover, it doesnt wait for the documents to be saved. whatever operation you do with Services for objects is instantaneous.
thanks & regards,
Sudhahar R
2010 Feb 08 12:28 PM
http://wiki.sdn.sap.com/wiki/display/Snippets/GOSURLAdditiontoBusiness+Object
/people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background
Edited by: Krupaji on Feb 8, 2010 1:28 PM
2010 Feb 11 7:39 AM
Hi Sudhahar and Vinod,
thanks for your replies. Issue was solved by a member of my team. I will post a solution here, when a development will be finished.
Adrian
2010 Mar 12 8:32 PM
Hi Adrian,
If possible can you please share how you resolved the issue?
Thanks in advance,
Karuna.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |