Application Development and Automation 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: 
Read only

Subroutines

Former Member
0 Likes
956

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
923

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.

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.

6 REPLIES 6
Read only

Former Member
0 Likes
924

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.

Read only

Former Member
0 Likes
923

hi Venu,

Do this way ..

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

<b>/:ENDFORM.</b>

Regards,

santosh

Read only

Former Member
0 Likes
923

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.

Read only

Former Member
0 Likes
923

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.

Read only

0 Likes
923

Hi,

Can any one send me the sample code for this.

Venu

Read only

0 Likes
923

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&