Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

VT01N - Generate IDOC only when Shipment Completion is pressed

Former Member
0 Kudos

I need to have an outbound IDOC triggered only when the shipment completion button is pressed. In case the shipment is saved without pressing the shipment completion button, the shipment number should be allowed to be created, but no IDOC must be triggered.

Steps already followed -

1. I tried to code in the user exit of IDOC_OUTPUT_SHPMNT trying to raise an exception when the VTTK-STABF (Shipment completion flag) was not checked.

2. I tried to clear the IDOC control data structures in the user exit.

In both the cases the idoc is being generated with a red error line item in the messages. According to my requirement only in case of Shipment Completion being checked should a green line item for success be logged. In all other cases nothing should be logged.

Please, let me know if such a requirement is feasible or not. If feasible, please help.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Any ideas?

5 REPLIES 5

Former Member
0 Kudos

Any ideas?

0 Kudos

It seems I have found some clue to solve this.

I am trying to create a filter in BD64, to filter the IDOCs on basis of the shipment completion flag. I am facing only one problem - I am unable to determine the receiver and sender numbers, while creating the distribution view in BD64.

I looked up the control record information, but everything expect the receiver number mentioned in the control record is showing up in the F4 help (during creation of BD64 filter).

Any ideas how to get the receiver and sender? 

0 Kudos

Helllo ,

You need to control it using the output control .Talk to your functional .The output type which you are trigering should have a routine which will stop the output from getting triggered .I will leave upto you and your functional to decide which routine no has to be used.

Thanks,

Anjaneya Bhardwaj

0 Kudos

Thanks Ajaneya.

Your solution worked.

I inserted the following code in the requirement routine (that was configured from tcode NACE ), and it worked.

FORM kobev_916.

   DATA:

         table_name(50) TYPE c,

         ls_vttk TYPE vttk.

   FIELD-SYMBOLS:

                 <fs_vttk> TYPE STANDARD TABLE.

* This table contains shipment data, accessed from the stack

   table_name = '(SAPMV56A)XVTTK[]'.

   ASSIGN (table_name) TO <fs_vttk>.

* It contains only one line in my case

   READ TABLE <fs_vttk> INDEX 1

                        INTO ls_vttk.

   IF sy-subrc IS INITIAL.


*   If the completion flag is on

     IF ls_vttk-stabf = 'X'.

       sy-subrc = 0.

     ELSE.

       sy-subrc = 4.

     ENDIF.

   ELSE.

     sy-subrc = 4.

   ENDIF.

ENDFORM.

Former Member
0 Kudos

You can use requirement 50 in Customizing for the message type, which trigges the IDOC.

Customizing path is LE/Transportation/Basic Transportation Functions/Output Control/Maintain Output Determination for Shipments/Maintain Output Determination Procedure.

If you are not familiar with it, ask your consultant.

KR

Alfons