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: 

Status_read FM not working properly in outbound idoc

Former Member
0 Kudos

Hi all,

I am updating custom segment with status of quotation in outbound idoc FM (IDOC_OUTPUT_ORDRSP ) in exit EXIT_SAPLVEDC_003

1. Status_read Function module working fine for all status in runtime except approval status for pending status it is working fine. ( I checked the code with hardcoded text for approval Status and it works , So Jest table not  updating approval status at run time process ).

2. Status_read FM not returning approval status at runtime from va22 , but if we run the idoc manually then it works fine .

* Get BELNR ( Which will have the Sales order number in this interface )
       lv_vbeln = ls_e1edk01-belnr.

* Converting to internal format
       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
         EXPORTING
           input  = lv_vbeln
         IMPORTING
           output = lv_vbeln.


       IF lv_vbeln IS NOT INITIAL.
* Get Sales Order Header details

         SELECT SINGLE vbeln
                       erdat
                       erzet
                       ernam
                       angdt
                       auart
                       objnr
                       ktext
                       vkorg FROM vbak INTO ls_vbak
                                   WHERE vbeln EQ lv_vbeln.
         IF sy-subrc EQ 0.

* Get the Status Profile and User Stauts
           CALL FUNCTION 'STATUS_READ'
             EXPORTING
               objnr            = ls_vbak-objnr
               only_active      = lc_x
             IMPORTING
               obtyp            = lv_obtyp
               stsma            = lv_stsma
               stonr            = lv_stonr
             TABLES
               status           = lt_status
             EXCEPTIONS
               object_not_found = 1
               OTHERS           = 2.
           IF sy-subrc EQ 0.
* Delete records other than the User status
             DELETE lt_status WHERE stat NA lc_e.

* Read the active user status
             READ TABLE lt_status INTO ls_status WITH KEY inact = space.
             IF sy-subrc EQ 0.
               IF lv_stsma IS NOT INITIAL AND ls_status-stat IS NOT INITIAL.
                 SELECT SINGLE txt30 FROM tj30t INTO ( lv_text )
                                       WHERE stsma EQ lv_stsma
                                        AND  estat EQ ls_status-stat
                                        AND  spras EQ sy-langu. "#EC WARN_OK
               ENDIF.
             ENDIF.
* Object status text
           ENDIF.
         ENDIF.


Please help me in this

2 REPLIES 2

Former Member
0 Kudos

I checked there is workflow on approved status ...thats why it is not working ? is there any other alternative method to read status

0 Kudos

Hello friends ,

Is there any other way to read sttaus of order in outbound idoc before workflow process for approval .

As status_read not returning till order till workflow processed.