06-30-2021 8:43 AM
After creating a transport request, is there any way to check whether documentation for that tr is made or not?
Like, when we release a task it displays a text editor where we can maintain documentation. But I want to check whether documentation is there or not and if it is not there then don't release the tr.
Is there any way to do this?
06-30-2021 9:19 AM
Hi vg24 ,
It is possible. You need to implement a BADI CTS_REQUEST_CHECK. Use the method CHECK_BEFORE_RELEASE to check the documentation.
A short code suggestion below can help you.
DATA lv_found TYPE i.
DATA lv_object TYPE doku_obj.<br>
MOVE request TO lv_object.
**Check whether the transport contains the documentation,
CALL FUNCTION 'DOCU_INIT'
EXPORTING
id = 'TA'
object = lv_object
typ = 'T'
IMPORTING
found = lv_found.
IF lv_found EQ 0.
EXIT.
ENDIF.
IF lv_found NE 0.
CALL FUNCTION 'DEQUEUE_E_TRKORR'
EXPORTING
trkorr = request.
MESSAGE e000 WITH request.
ENDIF.<br>
06-30-2021 8:47 AM
06-30-2021 9:19 AM
Hi vg24 ,
It is possible. You need to implement a BADI CTS_REQUEST_CHECK. Use the method CHECK_BEFORE_RELEASE to check the documentation.
A short code suggestion below can help you.
DATA lv_found TYPE i.
DATA lv_object TYPE doku_obj.<br>
MOVE request TO lv_object.
**Check whether the transport contains the documentation,
CALL FUNCTION 'DOCU_INIT'
EXPORTING
id = 'TA'
object = lv_object
typ = 'T'
IMPORTING
found = lv_found.
IF lv_found EQ 0.
EXIT.
ENDIF.
IF lv_found NE 0.
CALL FUNCTION 'DEQUEUE_E_TRKORR'
EXPORTING
trkorr = request.
MESSAGE e000 WITH request.
ENDIF.<br>
06-30-2021 9:27 AM
Thanks a lot semkum
I believe the loop begins before function call.
06-30-2021 9:52 AM
Thanks. there is no loop required, and my code had loop for someother reason. I have removed it now. Please accept the answer if your implementation works.
Regards
Senthil.
06-30-2021 10:14 AM
07-02-2021 8:04 AM
semkum what can be given in 'langu' within the function call DOCU_INIT?
07-02-2021 8:08 AM
vg24 , it should be SPRAS value (en, de) which needs to be passed. Basically, the language in which the text will be stored in the table.
Regards
Senthil.
07-02-2021 8:10 AM
07-05-2021 7:55 AM
semkum if the check has to be made only for a TR and not task, then how can it be done?
I have been trying to make an internal table of type E070 and looping through it. Wherever STRKORR eq '' and TRKORR eq lv_object, the function is being called and if not then I'm simply executing it. But this method is not working. It is not checking whether the object is a task or TR. Please help here.
06-30-2021 9:20 AM
Can you elaborate a bit more about it? I'm new to this.
Thank you!