Skip to Content
Former Member
Dec 14, 2006 at 04:03 PM

Code correction reg. subroutine in sapscript


I wrote a subroutine for my modified sapscript program. In that subroutine, I am retrieving price values (vbap-kzwi5) and passing it to the output table like this:

DATA: zvbeln LIKE vbak-vbeln,

zposnr LIKE vbap-posnr,

zkwmeng LIKE vbdpa-kwmeng,

kzvalue LIKE vbap-kzwi5.

FORM get_kz TABLES input_par STRUCTURE itcsy

output_par STRUCTURE itcsy.

READ TABLE input_par WITH KEY name = 'VBDKA-VBELN' .

MOVE input_par-value TO zvbeln.

READ TABLE input_table WITH KEY name = 'VBDPA-POSNR'

MOVE input_par-value TO zposnr.



input = zvbeln


output = zvbeln.

SELECT SINGLE kzwi5 kwmeng FROM vbap

INTO (kzvalue, zkwmeng) WHERE vbeln = zvbeln

AND posnr = zposnr.

MOVE: 'KZ' TO output_par-name.

MOVE: kzvalue TO output_par-value.

APPEND output_table .

CLEAR output_table.


Now my question is - Tthe output_par-value is still not getting the value of kzvalue when I debugged the program even after 'Move' statement. Can you please look at it and tell me the necessary code correction?

Thanks a lot.