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

Subroutines

Hi Friends,

I want to get the data from the subroutine in the script without modifying the standard program,

Based on Billing Doc No.(Vbrk-vbeln) I have to get vbak-knumv.

Can any one send me the sample code I would be grate.

Thanx in advance,

Venu.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 12:19 PM

    In sapscript put:

    /: PERFORM <form> IN PROGRAM <prog>

    /: USING &INVAR1&

    /: USING &INVAR2&

    ......

    /: CHANGING &OUTVAR1&

    /: CHANGING &OUTVAR2&

    ......

    /: ENDPERFORM

    in program <prog> put a subroutine with following parameters:

    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY

    OUT_PAR STRUCTURE ITCSY.

    ....

    ENDFORM.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 12:25 PM

    hi Venu,

    Do this way ..

    <b>/: PERFORM FORM_1 IN PROGRAM ZREPORT.</b>

    <b>/:ENDFORM.</b>

    Regards,

    santosh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 12:31 PM

    The link between billing doc and sales order can be of 1->many type.

    vbrk->vbrp->vbak.

    vbrk-vbeln links to vbrp-vbeln.

    vbrp-aubel links vbak-vbeln.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      here is to use TAX number field stcd2

      use it for your purpose

      1. create in se 80 zrutin.

      FORM GETPIB TABLES IN_PAR STRUCTURE ITCSY

      OUT_PAR STRUCTURE ITCSY.

      DATA: LV_KUNNR TYPE KUNNR.

      LOOP AT IN_PAR WHERE NAME = 'VBDKA-KUNNR'.

      CONDENSE IN_PAR-VALUE.

      MOVE IN_PAR-VALUE TO LV_KUNNR.

      ENDLOOP.

      IF SY-SUBRC <> 0 .

      LOOP AT IN_PAR WHERE NAME = 'VBDKR-KUNRE'.

      CONDENSE IN_PAR-VALUE.

      MOVE IN_PAR-VALUE TO LV_KUNNR.

      ENDLOOP.

      ENDIF.

      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

      EXPORTING

      INPUT = LV_KUNNR

      IMPORTING

      OUTPUT = LV_KUNNR.

      LOOP AT OUT_PAR WHERE NAME = 'STCD2'.

      SELECT SINGLE STCD2 FROM KNA1 INTO

      OUT_PAR-VALUE WHERE KUNNR = LV_KUNNR.

      MODIFY OUT_PAR INDEX SY-TABIX.

      ENDLOOP.

      ENDFORM. " GETP

      /: PERFORM GETPIB IN PROGRAM ZRUTIN

      /: USING &VBDKA-KUNNR&

      /: CHANGING &STCD2&

      /: ENDPERFORM

      AS <B>PIB: &STCD2&

  • author's profile photo Former Member
    Former Member
    Posted on Oct 19, 2006 at 12:26 PM

    copy that standard program into another program and change that program name in the script and change the copied program according to our use, there will be small change in that subroutine with regard to field, if you can analyse you will find it easily.

    i am not able to send the code as currently i am not able to find.

    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.