Skip to Content
author's profile photo Former Member
Former Member

Posted Sales Orders

Hi All,

May I know how will I select sales order documents that are posted for a particular Fiscal Year and Fiscal Period?

Thanks All!!!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 05:57 AM

    Hi

    Hope the below code can give you some idea.

    parameters: p_month like T009B-POPER,
                p_year  like T009B-BDATJ.
    
    constants: c_periv like T009B-PERIV value 'F1'.
    
    data: l_begin like sy-datum,
          l_end like sy-datum.
    
     CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
       EXPORTING
         I_GJAHR              = p_year
    *    I_MONMIT             = 00
         I_PERIV              = c_periv
         I_POPER              = p_month
      IMPORTING
        E_DATE               = l_begin
      EXCEPTIONS
        INPUT_FALSE          = 1
        T009_NOTFOUND        = 2
        T009B_NOTFOUND       = 3
        OTHERS               = 4
               .
     IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
     ENDIF.
    
     CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
       EXPORTING
         I_GJAHR              = p_year
    *    I_MONMIT             = 00
         I_PERIV              = c_periv
         I_POPER              = p_month
      IMPORTING
        E_DATE               = l_end
      EXCEPTIONS
        INPUT_FALSE          = 1
        T009_NOTFOUND        = 2
        T009B_NOTFOUND       = 3
        OTHERS               = 4
               .
     IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
     ENDIF.
    
     types: begin of t_vbak,
              vbeln like vbak-vbeln,
              auart like vbak-auart,
              vkorg like vbak-vkorg,
              vtweg like vbak-vtweg,
              spart like vbak-spart,
              erdat like vbak-erdat,
            end of t_vbak.
     data: it_vbak type standard table of t_vbak,
           wa_vbak type t_vbak.
    
     select vbeln auart vkorg vtweg spart erdat
            into table it_vbak
            from vbak
            where erdat ge l_begin
            and   erdat le l_end.

    Kind Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.