2007 Jul 30 4:30 PM
Hello all,
I have written a module program which have 2 screens one accept purchase order num and the other displays the pruchase order details.
My problem is after i hav written my first select statement im going for sy-subrc check but though i m providing valid purchase order number why still its throwing error that no data found.
frnds i m below providing my code.
<code> REPORT Z_50835_TRANS_ASSIGN56 MESSAGE-ID Zmsg12.
tables : ekko,ekpo.
data: ok_code type sy-ucomm,
save_ok like ok_code.
data : begin of git_ekko occurs 0,
ebeln like ekko-ebeln,
bukrs like ekko-bukrs,
bedat like ekko-bedat,
end of git_ekko,
begin of git_ekpo occurs 0,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
statu like ekpo-statu,
aedat like ekpo-aedat,
end of git_ekpo.
data : v_ebeln like ekko-ebeln.
CALL SCREEN 0499.
CONTROLS TABLE1 TYPE TABLEVIEW USING SCREEN '0502'.
MODULE STATUS_0499 output.
set pf-status 'ABC'.
endmodule.
MODULE USER_COMMAND_0499 INPUT.
OK_CODE = SY-UCOMM.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'GET'.
PERFORM GET_DATA_EKKO.
PERFORM GET_DATA_EKPO.
CALL SCREEN 502.
ENDCASE.
ENDMODULE. " USER_COMMAND_0499 INPUT
Form get_data_ekko.
*clear git_ekko[].
select ebeln
bukrs
bedat
into corresponding fields of table GIT_EKKO from ekko where ebeln = v_ebeln.
if sy-subrc NE 0.
MESSAGE e000(zmsg12) with 'no ekko data found'.
else.
append GIT_EKKO.
endif.
endform.
form get_data_ekpo.
clear git_ekpo[].
if not git_ekko[] is initial.
sort git_ekko by ebeln.
select
ebeln
ebelp
statu
aedat
from ekpo into table ( git_ekpo-ebeln, git_ekpo-ebelp, git_ekpo-statu, git_ekpo-aedat )
from ekpo into corresponding fields of table git_ekpo
for all entries in git_ekko
where ebeln = git_ekko-ebeln.
if sy-subrc <> 0.
message e000 with 'no data found'.
endif.
endif.
endform.</code>
sanjay
Message was edited by:
sanjay jaju
Message was edited by:
sanjay jaju
Message was edited by:
sanjay jaju
2007 Jul 30 4:34 PM
HI,
This could be due to the format of v_ebeln.
Convert the V_ebeln into internal format and then check
Conversion_exit_alpha_input.
exporting
input = v_ebeln
importing
output = v_ebeln.
select ebeln bukrs bedat into corresponding fields of table GIT_EKKO from ekko where ebeln = v_ebeln. if sy-subrc NE 0. MESSAGE endif.
Thanks,
Mahesh
2007 Jul 30 4:41 PM
No frnd,
still its saying that no data found.
can u help me.
thanks,
sanjay
2007 Jul 30 4:34 PM
2007 Jul 30 4:39 PM
hi
good
did you check with your sy-subrc value,check in the debug mode that what value sy-subrc is retruning at that time.
thanks
mrutyun^
2007 Jul 30 4:41 PM
2007 Jul 30 5:05 PM
HI,
1) Check the table if you have those entries
2) check the value of v_ebeln during runtime.
3) Use the conversion exit function module.
There are the only possibilites that could happen for not finding the vaalues..
Just try using select * and see if it works insted of some fields (Just for test purpose)
Thanks
Mahesh
2007 Jul 30 5:26 PM
Hi all,
I have done small change in the code but still i m getting three item details related to one header details i.e purchase order number but with that i m still getting a dummy data i.e one more purchase order details
i.e suppose i hav entered 3000 , so i m getting 3 item with that i m gettig one more item i.e 6000
my changed code for which i m getting problem is
<code> REPORT Z_50835_TRANS_ASSIGN56 MESSAGE-ID Zmsg12.
tables : ekko,ekpo.
data: ok_code type sy-ucomm,
save_ok like ok_code.
data : begin of git_ekko occurs 0,
ebeln like ekko-ebeln,
bukrs like ekko-bukrs,
bedat like ekko-bedat,
end of git_ekko,
begin of git_ekpo occurs 0,
ebeln like ekpo-ebeln,
ebelp like ekpo-ebelp,
statu like ekpo-statu,
aedat like ekpo-aedat,
end of git_ekpo.
data : v_ebeln like ekko-ebeln.
CALL SCREEN 0499.
CONTROLS TABLE1 TYPE TABLEVIEW USING SCREEN '0502'.
MODULE STATUS_0499 output.
set pf-status 'ABC'.
endmodule.
MODULE USER_COMMAND_0499 INPUT.
OK_CODE = SY-UCOMM.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'GET'.
PERFORM GET_DATA_EKKO.
PERFORM GET_DATA_EKPO.
CALL SCREEN 502.
ENDCASE.
ENDMODULE. " USER_COMMAND_0499 INPUT
Form get_data_ekko.
*clear git_ekko[].
*Conversion_exit_alpha_input.
*exporting
*input = v_vbeln
*importing
*output = v_vbeln.
select ebeln from ekko into v_ebeln.
*
*CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = v_ebeln
IMPORTING
OUTPUT = v_ebeln.
select ebeln
bukrs
bedat
into corresponding fields of table GIT_EKKO from ekko where ebeln = v_ebeln.
if sy-subrc NE 0.
MESSAGE e000(zmsg12) with 'no ekko data found'.
else.
append GIT_EKKO.
endif.
endselect.
endform.
form get_data_ekpo.
clear git_ekpo[].
if not git_ekko[] is initial.
sort git_ekko by ebeln.
select
ebeln
ebelp
statu
aedat
from ekpo into table ( git_ekpo-ebeln, git_ekpo-ebelp, git_ekpo-statu, git_ekpo-aedat )
from ekpo into corresponding fields of table git_ekpo
for all entries in git_ekko
where ebeln = git_ekko-ebeln.
if sy-subrc <> 0.
message e000 with 'no data found'.
endif.
endif.
endform. </code>
thnks,
sanjay
2007 Jul 30 5:32 PM
2007 Jul 30 5:46 PM
HI,
Check the hilighted part
select ebeln
bukrs
bedat
into corresponding fields of table GIT_EKKO from ekko where ebeln = v_ebeln.
if sy-subrc NE 0.
MESSAGE e000(zmsg12) with 'no ekko data found'.
else.
<b>append GIT_EKKO.</b> " You dont need this remove and try
endif.
Thanks
Mahesh