Skip to Content
4
Former Member
Jul 30, 2007 at 03:30 PM

Sy-subrc

13 Views

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