Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Sy-subrc

Former Member
0 Kudos

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

9 REPLIES 9

Former Member
0 Kudos

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

0 Kudos

No frnd,

still its saying that no data found.

can u help me.

thanks,

sanjay

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Make sure that the field in screen painter has the conversion exit specified as ALPHA and it has a length of 10.

So go to screen painter, and double click on your field, in the dialog box, click on the tabs at the bottom to find the Conversion Routine field, enter ALPHA.

REgards,

Rich Heilman

Former Member
0 Kudos

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^

0 Kudos

Its always returning 4 why i dont know.

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

Suggestion frnds.

thanks,

sanjay

0 Kudos

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