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

Standard Text

Former Member
0 Likes
702

Hi all,

How can i print dyanamic data in so10.

i know it is possible by creating external subroutines.

any one tell me how to create external subroutone.

Regards,

Ashwin

Hi all,

How can i print dyanamic data in so10.

i know it is possible by creating external subroutines.

any one tell me how to create external subroutone.

Regards,

Ashwin

4 REPLIES 4
Read only

Former Member
0 Likes
660

you can use for instance the variable names between & & signs in you're text object.

you loop through the text and replace the name of the variabele for the value it has in you're programm. you can use form fields for this trick.

Read only

Former Member
0 Likes
660

Hello,

Create the Std. Text like this:

/E Carried to next page <b>&RFCASH-WAERS&</b>

For the Variable RFCASH-WAERS U could pass the value from ur print program.

Regards,

Vasanth

Read only

0 Likes
660

Hi vasanth,

Thanq for ur reply.

I know that one and here am using sap standard print program.

How can i modify print program or how can i write external subroutines.

Regards,

Ashwin

Read only

0 Likes
660

Hello Ashwin,

U can write the routine as you do in Forms.

Try this EG:

PERFORM GET_VEND_NAME_MOD IN PROGRAM /RB17/YV_FORMS_PUTAWAY_LIST

USING &LTAK-VBELN&

USING &LTAP-POSNR&

USING &LTAK-LGNUM&

USING &LTAK-BWART&

USING &LTAK-BWLVS&

USING &LTAK-MBLNR&

USING &LTAK-MJAHR&

CHANGING &VEND_NAME&

CHANGING &TRAID&

CHANGING &SHIPPING_UNIT&

CHANGING &VEKP_VKORG&

CHANGING &VEKP_VTWEG&

FORM get_vend_name_mod TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy .

DATA : z_vbeln LIKE ltak-vbeln,

z_lgnum LIKE ltak-lgnum,

z_bwart LIKE ltak-bwart,

z_bwlvs LIKE ltak-bwlvs,

z_mblnr LIKE ltak-mblnr,

z_mjahr LIKE ltak-mjahr,

z_posnr LIKE ltap-posnr,

l_f_handle LIKE vevw-handle,

l_f_werks LIKE mseg-werks,

l_f_objkey(14) TYPE c,

l_f_stock1(35) TYPE c.

CONSTANTS : l_f_stock(35) TYPE c VALUE 'Stock Transfer from Plant 9060'.

CLEAR : likp,lfa1.

  • Get the delivery number

READ TABLE in_tab WITH KEY name = 'LTAK-VBELN'.

CHECK sy-subrc = 0.

z_vbeln = in_tab-value.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = z_vbeln

IMPORTING

output = z_vbeln.

  • position number

READ TABLE in_tab WITH KEY name = 'LTAP-POSNR'.

CHECK sy-subrc = 0.

z_posnr = in_tab-value.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = z_posnr

IMPORTING

output = z_posnr.

  • Warehouse number

READ TABLE in_tab WITH KEY name = 'LTAK-LGNUM'.

IF sy-subrc = 0.

z_lgnum = in_tab-value.

ENDIF.

  • Movement type

READ TABLE in_tab WITH KEY name = 'LTAK-BWART'.

IF sy-subrc = 0.

z_bwart = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY name = 'LTAK-BWLVS'.

IF sy-subrc = 0.

z_bwlvs = in_tab-value.

ENDIF.

  • Material document number and year

READ TABLE in_tab WITH KEY name = 'LTAK-MBLNR'.

IF sy-subrc = 0.

z_mblnr = in_tab-value.

ENDIF.

READ TABLE in_tab WITH KEY name = 'LTAK-MJAHR'.

IF sy-subrc = 0.

z_mjahr = in_tab-value.

ENDIF.

CONCATENATE z_mblnr z_mjahr INTO l_f_objkey.

IF ( z_lgnum = 'A11' AND z_bwart = '301' AND z_bwlvs = '302' ).

SELECT SINGLE handle INTO l_f_handle FROM vevw

WHERE object = 'MM' AND

objkey = l_f_objkey.

IF sy-subrc EQ 0 AND

NOT l_f_handle IS INITIAL.

SELECT SINGLE * FROM vekp

WHERE handle = l_f_handle.

g_f_exidv = vekp-exidv.

ENDIF.

SELECT SINGLE werks INTO l_f_werks FROM mseg

WHERE

mblnr = z_mblnr AND

mjahr = z_mjahr AND

shkzg = 'H'.

IF sy-subrc EQ 0

AND l_f_werks EQ '9060'.

l_f_stock1 = l_f_stock.

ENDIF.

SELECT SINGLE * FROM likp

WHERE vbeln = z_vbeln .

IF sy-subrc EQ 0 .

SELECT SINGLE * FROM lfa1

WHERE lifnr = likp-lifnr.

ENDIF.

ELSE.

SELECT SINGLE * FROM likp

WHERE vbeln = z_vbeln .

IF sy-subrc EQ 0 .

SELECT SINGLE * FROM lfa1

WHERE lifnr = likp-lifnr.

l_f_stock1 = lfa1-name1.

ENDIF.

SELECT SINGLE vbeln FROM vbfa

INTO vbfa-vbeln

WHERE vbtyp_n = 'X'

AND vbelv = z_vbeln.

SELECT SINGLE * FROM vepo

WHERE venum = vbfa-vbeln.

IF sy-subrc EQ 0 .

SELECT SINGLE * FROM vekp

WHERE venum = vepo-venum.

ENDIF.

IF vekp-exidv IS INITIAL.

SELECT SINGLE * FROM vekp

WHERE vpobj IN ('01','03')

AND vpobjkey = z_vbeln.

g_f_exidv = vekp-exidv.

ENDIF.

ENDIF.

READ TABLE out_tab WITH KEY name = 'VEND_NAME'.

CHECK sy-subrc = 0.

out_tab-value = l_f_stock1.

SHIFT out_tab-value LEFT DELETING LEADING space.

MODIFY out_tab INDEX sy-tabix.

READ TABLE out_tab WITH KEY name = 'TRAID'.

CHECK sy-subrc = 0.

out_tab-value = likp-traid.

SHIFT out_tab-value LEFT DELETING LEADING space.

MODIFY out_tab INDEX sy-tabix.

READ TABLE out_tab WITH KEY name = 'SHIPPING_UNIT'.

CHECK sy-subrc = 0.

out_tab-value = g_f_exidv.

SHIFT out_tab-value LEFT DELETING LEADING space.

SHIFT out_tab-value LEFT DELETING LEADING '0'.

MODIFY out_tab INDEX sy-tabix.

READ TABLE out_tab WITH KEY name = 'VEKP_VKORG'.

CHECK sy-subrc = 0.

out_tab-value = vekp-vkorg.

MODIFY out_tab INDEX sy-tabix.

READ TABLE out_tab WITH KEY name = 'VEKP_VTWEG'.

CHECK sy-subrc = 0.

out_tab-value = vekp-vtweg.

MODIFY out_tab INDEX sy-tabix.

*} INSERT

ENDFORM. "get_vend_name_mod

Vasanth