Application Development and Automation 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: 
Read only

ASAP

Former Member
0 Likes
905

Hi,

In my program i will enter the vendor number and idoc date based on the input given it will if any of the idocs are in 51 or 68 status if so it displays the corresponding details.Now the problem is if the idoc status is not 51 or 68 the report generated is blank instead it should display a error message.How to code ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
873

If there is no data according to your selection then your internal table, which you will be displaying as output, will be initial.

Then write below statement.

if itab[] is initial.

message 'No Records found' type 'E'

endif.

Reward Point if Useful.

6 REPLIES 6
Read only

Former Member
0 Likes
873

Hi,

Use CASE and ENDCASE statement, write the code the each status and finally write WHEN OTHERS, under this write the code for error message.

Example:

CASE.

WHEN '0'.

<your code>.

.

.

.

..

WHEN OTHERS.

<Code for error message>.

ENDCASE.

Read only

0 Likes
873

Hi see the coding what i have did and suggest me..Have used if stmt

IF gw_cntrl_rcrd-status = 51 OR gw_cntrl_rcrd-status = 68.

  • Get vendor details

PERFORM get_details.

  • get details of errored idoc

PERFORM get_idoc_errors.

ENDIF.

Read only

0 Likes
873

Hi still am getting error..I have coded like this so for all the status am getting the error message..How to correct it?

IF gw_cntrl_rcrd-status = 51 OR gw_cntrl_rcrd-status = 68.

  • Get vendor details

PERFORM get_details.

  • get details of errored idoc

PERFORM get_idoc_errors.

else.

MESSAGE e000 WITH 'None of the idocs is in status 51 or 68'.

ENDIF.

Read only

Former Member
0 Likes
874

If there is no data according to your selection then your internal table, which you will be displaying as output, will be initial.

Then write below statement.

if itab[] is initial.

message 'No Records found' type 'E'

endif.

Reward Point if Useful.

Read only

0 Likes
873

Please see the above coding..In that i have specified if its 51 or 68 it should perform the particular task...Now in this case if its in other status the error message should be displayed...How to proceed from my coding part?

Read only

0 Likes
873

Hi,

Please write the complete code so that i can give you some suggestions.

Regards,

Shailesh Jadhav