05-06-2013 4:46 PM
Hi gurus,
I have to pass some work area data to sap script , i have checked in debug mode also i am not able to see any value in sap script debug mode.
Below is the sample code.
data : wa_track type tp_track.
loop at it_track into wa_track.
perform set_trkid using '&VHILM_KU&' wa_track-VHILM_KU.
endloop.
form SET_TRKID using VHILM_KU VHILM_KU1.
data : wa_track type tp_track.
loop at it_track into wa_track.
VHILM_KU1 = wa_track-VHILM_KU.
endloop.
endform. " SET_TRKID
attached is the code where i am paasing the internal table data
Script code is shown below
MG &WGBEZ+0(30)&
MG &WGBEZ+30(30)&
/: ENDIF.
CP TRACKING ID:
RF &VHILM_KU&
CP &VHILM_KU1&
MG &VHILM_KU1&
MG &VHILM_KU&
please help it is bit urgent.
05-06-2013 11:14 PM
Hi,
Try to do change editor and try inserting the Text Symbols via Insert->Symbols->Text Symbols.
Cheers,
Arindam
05-06-2013 5:12 PM
Ravi,
You are looping at it_track and then calling the perform set_trkid. So for all entries in the loop this routine will get called. So why are you looping again inside the perform?
loop at it_track into wa_track.
perform set_trkid using wa_track-VHILM_KU.
changing VHILM_KU. * do not use &
endloop.
form SET_TRKID using VHILM_KU VHILM_KU1.
data : wa_track type tp_track.
loop at it_track into wa_track.
VHILM_KU1 = wa_track-VHILM_KU.
endloop.
endform. " SET_TRKID
Hope this works.
Thanks,
Vikram.M
05-06-2013 5:15 PM
ok but i am not able to pass the value of VHILM_KU1 in sap script i tried with all possibilities
05-06-2013 5:17 PM
05-06-2013 5:43 PM
hello,
I guess if I understood your issue correctly you are passing values from a program(include with subroutine) to sapscript.
If so here is an example of how to do that
http://wiki.sdn.sap.com/wiki/display/ABAP/Subroutines+And+Their+Use+In+SAPScript
Check this link and it gives good example of how to do that. I htink your issue is you are passing the values correctly but not reading them correctly in the sapscript.
best regards,
swanand
05-06-2013 5:49 PM
Hi
you have to use below function.,To pass data to script .
call function 'WRITE_FORM' .
05-06-2013 11:14 PM
Hi,
Try to do change editor and try inserting the Text Symbols via Insert->Symbols->Text Symbols.
Cheers,
Arindam
05-08-2013 3:50 PM
i did it my self, Thank you guys for your answers.
below is the process where i passed internal table data to script window
read table it_track into wa_track with key vbelv = it_lips-vbeln.
perform set_trkid using '&VHILM_KU&' wa_track-VHILM_KU.
PERFORM write_form
*call window
PERFORM z_write_form USING 'MATGRP' 'BODY' 'MATGRP'
**********************FORM CODE*********************
form SET_TRKID using col_name col_value.
data : wa_track type tp_track.
CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
EXPORTING
name = col_name
value = col_value
* VALUE_LENGTH = 0
* REPLACE_SYMBOLS = ' '
EXCEPTIONS
OTHERS = 1.
endform. " SET_TRKID
FORM z_write_form USING p_windowelement TYPE c
p_type TYPE c
p_window TYPE c.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = p_windowelement
function = 'SET'
type = p_type
window = p_window
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
OTHERS = 8.
* clear d_subtotal.
ENDFORM. " Z_WRITE_FORM.........
***********************SCRIPT CODE***********************
MG &WGBEZ+0(30)&
MG &WGBEZ+30(30)&
/: ENDIF.
/* Begin of insert by ravi kumar on 06.05.2013
RF Shipper Name :&VTEXT&
RF Tracking ID :&VHILM_KU+0(35)&
/* End of insert by ravi kumar on 06.05.2013