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

code for validating the sales order

Hi,

can any body can send the code for validating sales order and shipment,when we enter the sales order or shipment as input in the selection screen.

It is very urgent....................

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jun 30, 2007 at 08:23 AM

    Sudarsan,

    data: begin of itab occurs 0.

    include structure tablename.

    data:end of itab.

    parameters:p_vbeln like vbak-vblen,

    p_ship like vbak-fieldname.

    select * from tablename into table itab where vbeln = p_vbeln and

    fieldname = p_ship.

    Note:- fieldname is the field for shipment,get it from the concerned table.

    tablename is the table from which you are selecting the data.

    K.Kiran.

    Message was edited by:

    Kiran K

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 30, 2007 at 08:28 AM

    hi,

    You need write the select statment in the AT SELECTION SCREEN event to chekc the fields which you declared in the Selection screen.

    parameters: P_VBELN like VBAK-VBELN.

    <b>AT SELECTION-SCREEN.</b>

    Select single * from VBAK where VBELN eq P_VBELN.

    IF SY-SUBRC <> 0.

    MESSAGE E000 with 'no sales order'

    endif.

    <b>Do the same way for Shipment also.</b>

    <b>or</b>

    you provide the logic for validate the user entered sales order number and shipment.

    <b>AT SELECTION-SCREEN ON P_VBELN.</b>

    Select single * from VBAK where VBELN eq P_VBELN.

    IF SY-SUBRC <> 0.

    MESSAGE E000 with 'no sales order'

    endif.

    <b>AT SELECTION-SCREEN ON <SHIPMENT>.</b>

    Regards

    Ashok

    Message was edited by:

    Ashok Reddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 30, 2007 at 08:29 AM

    HI,

    SEE TO THIS CODE.

    --


    TABLE DECLARATION--

    TABLES : VBAK,VBAP.

    TYPE-POOLS : SLIS.

    --


    STRUCTURE DECLARATION--

    TYPES : BEGIN OF TY_VBAK,

    VBELN TYPE VBELN_VA,

    ERDAT TYPE ERDAT,

    ERZET TYPE ERZET,

    ERNAM TYPE ERNAM,

    END OF TY_VBAK.

    --


    SELECT OPTIONS--

    SELECT-OPTIONS : S_VBAK FOR VBAK-VBELN.

    --


    START OF SELECTION--

    START-OF-SELECTION.

    SELECT VBELN

    ERDAT

    ERZET

    ERNAM

    FROM VBAK

    INTO TABLE IT_VBAK

    WHERE VBELN IN S_VBAK.

    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.