on 05-09-2008 9:14 AM
Hi experts,
I written a code for on subroutine pool.in that iam not getting in_tab value.
read table in_tab with key 'GS_EKKO-EBELN'.
if sy-subrc = 0.
gc_var = in_tab.
endif
for the above code iam not getting in_tab value. the code is as follows.
&----
*& Subroutine Pool ZAN_GOODS_RECEIPT
*&
&----
*&
*&
&----
PROGRAM ZAN_GOODS_RECEIPT.
*----
TABLES DECLARATION.
tables : likp,lips,ekko,ekpo.
*----
FORM STRUCTURE DECLARATION.
form f_head tables in_tab structure itcsy
out_tab structure itcsy.
*----
types declaration .
types:begin of gty_likp,
vbeln type likp-vbeln,
end of gty_likp,
begin of gty_lips,
vbeln type lips-vbeln,
vgbel type lips-vgbel,
end of gty_lips,
begin of gty_ekko,
ebeln type ekko-ebeln,
ekgrp type ekko-ekgrp,
end of gty_ekko,
begin of gty_output,
cno type mara-zeinr,
ekgrp type ekko-ekgrp,
end of gty_output.
*----
internal tables declaration.
data: gt_likp type standard table of gty_likp,
gt_lips type table of gty_lips,
gt_ekko type table of gty_ekko,
gt_output type table of gty_output.
*----
work area declaration.
data:gs_likp type gty_likp,
gs_lips type gty_lips,
gs_ekko type gty_ekko,
gs_output type gty_output.
*.............. constants declarations
data:gc_var(20) type c,
gc_var1(20) type c,
head type ekko-ekgrp.
select vbeln
into table gt_likp
from likp.
if sy-subrc = 0.
select vbeln
vgbel
into table gt_lips
from lips
for all entries in gt_likp
where vbeln = gt_likp-vbeln.
endif.
if sy-subrc = 0.
select ebeln
ekgrp
into table gt_ekko
from ekko
for all entries in gt_lips
where ebeln = gt_lips-vgbel.
endif.
read table in_tab with key 'GS_EKKO-EBELN'.
if sy-subrc = 0.
gc_var = in_tab.
endif.
read table gt_ekko into gs_ekko with key ebeln = gc_var binary search.
if sy-subrc = 0.
head = gs_ekko-ekgrp.
gC_var1 = head.
read table out_tab with key 'HEAD'.
if sy-subrc = 0.
move gc_var1 to out_tab-value.
modify out_tab index 1.
endif.
endif.
endform.
if any correction is there please correct the code.rewards are helpful answers.
Thanks & regards,
Narasimha Rao.
Hi,
It should be:
read table in_tab with key 'GS_EKKO-EBELN'.
if sy-subrc = 0.
gc_var = in_tab-VALUE.
endif
Reward if helpful.
Tyken
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.