07-04-2007 7:18 AM
Hi All,
I am using a select query in the subroutine and using that in the script,i ma able to see the values in the program in debug mode but if i check in the form values are not getting there.
SELECT vbeln posnr vgpos uecha
FROM lips
INTO TABLE it_lips
WHERE vbeln = w_vbeln
AND uecha = '0'.
SELECT posnr lgort uecha FROM lips
INTO TABLE it_lgort
FOR ALL ENTRIES IN it_lips
WHERE vbeln = w_vbeln
AND uecha = it_lips-posnr.
READ TABLE it_lgort INDEX 1.
IF sy-subrc EQ 0.
wk_item = it_lgort-posnr.
ENDIF.
I am using PERFORM 'LAYOUT_FORM10' IN PROGRAM 'Z_FORM_A_I_PRINT_FORM_ROUTINES' using....
changing wk_item
what is the problem??
regards,
sai
07-04-2007 7:22 AM
Hi,
You are seeing the values in the debugging mode means it is clear tht there is no wrong in query...After retrievung the query the values are not displayed...So you want to see where the values getting clear after tht query..
Otherwise see whether the data is siiting properly in the screen on the debug mode..That is check whether it is representing the fields prperly
REWARD IF USEFUL!!!!!!!!!!!!!!1
07-04-2007 7:25 AM
Hi,
I think u have problem in the subroutine calling only . U have to use
PERFORM 'LAYOUT_FORM10' IN PROGRAM 'Z_FORM_A_I_PRINT_FORM_ROUTINES' using w_vbeln Changing wk_item
Regards,
Nandha
Reward if it helps
07-04-2007 7:25 AM
Hi
You have to use ITCSY structure for both input and Output of the fields.Are you using that ?
see the sample code
How to call a subroutine form SAPscripts
The Form :
/:PERFORM CDE_CENT IN PROGRAM ZKRPMM_PERFORM_Z1MEDRUCK
/:USING &EKKO-EBELN&
/:CHANGING &CDECENT&
/:ENDPERFORM
The report :
REPORT zkrpmm_perform_z1medruck .
DATA : BEGIN OF it_input_table OCCURS 10.
INCLUDE STRUCTURE itcsy.
DATA : END OF it_input_table.
déclaration de la table output_table contenant les
variables exportées
DATA : BEGIN OF it_output_table OCCURS 0.
INCLUDE STRUCTURE itcsy.
DATA : END OF it_output_table.
DATA : w_ebeln LIKE ekko-ebeln,
w_vbeln LIKE vbak-vbeln,
w_zcdffa LIKE vbak-zcdffa.
*----
*
FORM CDE_CENT
*
*----
*
FORM cde_cent TABLES input output.
it_input_table[] = input[].
it_output_table[] = output[].
READ TABLE it_input_table INDEX 1.
MOVE it_input_table-value TO w_ebeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = w_ebeln
IMPORTING
output = w_ebeln.
SELECT SINGLE zcdffa FROM ekko
INTO w_zcdffa
WHERE ebeln = w_ebeln.
it_output_table-name = 'CDECENT'.
MOVE w_zcdffa TO it_output_table-value.
MODIFY it_output_table INDEX 1.
output[] = it_output_table[].
ENDFORM.
*************************************************************************
REPORT ZMPO1 .
form get_freight tables in_par structure itcsy out_par structure itcsy.
tables: ekko,konv,t685t.
data: begin of itab occurs 0,
ebeln like ekko-ebeln,
knumv like ekko-knumv,
end of itab.
data: begin of itab1 occurs 0,
knumv like konv-knumv,
kposn like konv-kposn,
kschl like konv-kschl,
kbetr like konv-kbetr,
waers like konv-waers,
kwert like konv-kwert,
end of itab1.
data: begin of iout occurs 0,
kschl like konv-kschl,
vtext like t685t-vtext,
kbetr like konv-kbetr,
kwert like konv-kwert,
end of iout.
data v_po like ekko-ebeln.
read table in_par with key 'EKKO-EBELN'.
if sy-subrc = 0.
v_po = in_par-value.
select
ebeln
knumv
from ekko
into table itab
where ebeln = v_po.
if sy-subrc = 0.
loop at itab.
select
knumv
kposn
kschl
kbetr
waers
kwert
into table itab1
from konv
where knumv = itab-knumv and
kappl = 'M'.
endloop.
loop at itab1.
if itab1-kposn <> 0.
select single * from t685t
where kschl = itab1-kschl
and kappl = 'M'
and spras = 'EN'.
iout-vtext = t685t-vtext.
iout-kschl = itab1-kschl.
iout-kbetr = itab1-kbetr.
iout-kwert = itab1-kwert.
append iout.
clear iout.
endif.
endloop.
sort itab1 by kposn.
loop at iout.
sort iout by kschl.
if ( iout-kschl eq 'GSDC' OR
iout-kschl eq 'GSFR' OR
iout-kschl eq 'GSIR' ).
at end of kschl.
read table iout index sy-tabix.
sum.
write:/ iout-kschl,iout-vtext,iout-kwert.
out_par-name = 'A1'.
out_par-value = iout-vtext.
append out_par.
out_par-name = 'A2'.
out_par-value = iout-kwert.
append out_par.
endat.
endif.
endloop.
endif.
endif.
endform.
IN THE FORM I AM WRITING THIS CODE.
/:DEFINE &A1& = ' '
/:DEFINE &A2& = ' '
/:PERFORM GET_FREIGHT IN PROGRAM ZMFORM_PO1
/:USING &EKKO-EBELN&
/:CHANGING &A1&
/:CHANGING &A2&
/:ENDPERFORM
&A1&
&A2&
This Code is to be written in the PO form under ADDRESS window.
-
-
/:DEFINE &A1& = ' '
/:DEFINE &A2& = ' '
/:DEFINE &A3& = ' '
/:DEFINE &A4& = ' '
/:DEFINE &A5& = ' '
/:DEFINE &A6& = ' '
/:PERFORM GET_VENDOR IN PROGRAM ZMFORM_PO
/:USING &EKKO-EBELN&
/:CHANGING &A1&
/:CHANGING &A2&
/:CHANGING &A3&
/:CHANGING &A4&
/:CHANGING &A5&
/:CHANGING &A6&
/:ENDPERFORM
&A1&
&A2&
&A3&
&A4&
&A5&
&A6&
Reward points for useful Answers
Regards
Anji
07-04-2007 7:47 AM
I am using foolowing read statement
READ TABLE it_outtab INDEX 1.
it_outtab-value = wk_item.
MODIFY it_outtab INDEX 1.
Now it is printing the value but the first line item value is printed multiple times..
Regards,
Sai
07-04-2007 7:54 AM
Hi Sai ,
While debugging please see what is the value of it_outtab-value , some times the value will be in right corner , thus you will have blank spaces in the frot , the data wil look line this
' 1234'.
in the script when you assign this value to a varaible of legth 6 , only blank values will be assigned ,and hence you will not able to see any thing as output.
If this is the case the use the condense statement to convert the data in
it_outtab-value to 1234 , if you do this you will get the correct output.
Please check this and feel free to revert back in case of further queries.
Regards
Arun
07-04-2007 9:30 AM
the value of it_outtab-value is ok it is first line item,my question it is printing all first line item hoe to print remaining.how to use read statement and assign to outtab (for multiple values)
07-04-2007 9:34 AM
Plese explain your requirement further , i am not able to make out what exactly is the output you want.
07-04-2007 9:36 AM
Hi
Write like this:
READ TABLE it_outtab INDEX 1.
it_outtab-value = wk_item.
MODIFY it_outtab INDEX 1.
READ TABLE it_outtab INDEX 2.
it_outtab-value = wk_item.
MODIFY it_outtab INDEX 2.
READ TABLE it_outtab INDEX 3.
it_outtab-value = wk_item.
MODIFY it_outtab INDEX 3.
.........................................
.........................................
Reward points for useful Answers
Regards
Anji
07-04-2007 7:26 AM
Check the form in the debugging mode and check where the data is getting cleared.
Important thing to note : Declare all the variable globally in the main program so that it can be accessible from the form also.
07-04-2007 10:31 AM
Hi,
Try this code to get values from internal table
SELECT vbeln posnr vgpos uecha
FROM lips
INTO TABLE it_lips
WHERE vbeln = w_vbeln
AND uecha = '0'.
SELECT posnr lgort uecha FROM lips
INTO TABLE it_lgort
FOR ALL ENTRIES IN it_lips
WHERE vbeln = w_vbeln
AND uecha = it_lips-posnr.
loop at it_lgort.
IF sy-subrc EQ 0.
wk_item = it_lgort-posnr.
append wk.
ENDIF.
IF USEFULL REWARD
07-04-2007 10:40 AM
Hi Udaya,
the main problem of ur's is abt select-query.
Ur query is all right,butthe data is not getting in form because of u can clear the data after getting once.
You can assure that the data is not cleared after that query.
I hope to do this u will resolve your problem.
Thanks
Sanket