Skip to Content
avatar image
Former Member

SC approval update

I have to write a query to know the status of the SC, the user wants to input only SC No and / or Date. The output should be the SC No. approved fully on that partucular date.

How do I correlate this in query.

Thanks / Bhavesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Mar 12, 2013 at 07:34 PM

    You can use following code to get a list of all the carts which were approved completely by a given date. It works correctly in my system. Let me know if this helps.

    TABLES: swwwihead.

    DATA: lt_wi2obj TYPE STANDARD TABLE OF sww_wi2obj,

           ls_wi2obj LIKE LINE OF lt_wi2obj.

    DATA: lv_guid LIKE crmd_orderadm_h-guid,

               ls_header TYPE bbp_pds_header,

               lt_header TYPE STANDARD TABLE OF bbp_pds_header.

    SELECT-OPTIONS:  s_apdate FOR swwwihead-wi_aed

                    DEFAULT sy-datum TO sy-datum OBLIGATORY.

    START-OF-SELECTION.

       SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_wi2obj

         FROM sww_wi2obj WHERE  catid = 'CL' AND wi_rh_task = 'WS40000014' AND typeid = '/SAPSRM/CL_WF_PDO_SC' AND top_wi_id IN (

         SELECT wi_id FROM swwwihead  WHERE wi_stat = 'COMPLETED' AND wi_aed IN s_apdate AND wi_rh_task = 'WS40000014' ).

       LOOP AT lt_wi2obj INTO ls_wi2obj.

         MOVE ls_wi2obj-instid TO lv_guid.

         CALL FUNCTION 'BBP_PROCDOC_GETDETAIL'

           EXPORTING

             i_guid          = lv_guid

             i_with_itemdata = ''

           IMPORTING

             e_header        = ls_header.

         APPEND ls_header TO lt_header.

       ENDLOOP.

       SORT lt_header BY object_id AS TEXT ASCENDING.

       PERFORM write_report .

    END-OF-SELECTION.

    *&---------------------------------------------------------------------*

    *&      Form  write_report

    *&---------------------------------------------------------------------*

    *       text

    *----------------------------------------------------------------------*

    FORM write_report .

       ULINE.

       LOOP AT lt_header INTO ls_header.

         WRITE: ls_header-object_id.

         ULINE.

       ENDLOOP.

    ENDFORM.                    " write_report

    Add comment
    10|10000 characters needed characters exceeded