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

coding help

Former Member
0 Likes
491

Dear friends,

FIELD-SYMBOLS: <t_ptp00> LIKE ptp00.

I have the field symbol like above, I need to code the below 5,6 and 7 points.can anyone show me how to code it

5) Check if <t_ptp00>-pernr exist in table t_tblreport_val.

6) if yes then exit.

7) If no then produce message " Field Exit: - Error: you have no authorization to this employee number" (Note that the message is already there)

thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
452

Read table t_tblreport_val with key pernr = <t_ptp00>-pernr.

if sy-subrc = 0.

exit.

else.

message E100(AS) with 'Field...'

endif.

3 REPLIES 3
Read only

Former Member
0 Likes
453

Read table t_tblreport_val with key pernr = <t_ptp00>-pernr.

if sy-subrc = 0.

exit.

else.

message E100(AS) with 'Field...'

endif.

Read only

Former Member
0 Likes
452

hi,

READ TABLE T_TBLREPORT_VAL WITH KEY PERNR = <T_PTP00>-PERNR.
IF SY-SUBRC = 0.
  EXIT.
ELSE.
  MESSAGE I000(ZZ) WITH ' Field Exit: - Error: you have no'
                        'authorization to this employee number'.
ENDIF.

Regards,

Sailaja.

Read only

Former Member
0 Likes
452

Hi,

use below logic

sort t_tblreport_val by pernr.

read table t_tblreport_val with key

pernr = <t_ptp00> binary search.

if sy-subrc q 0.

exit.

else.

message e219(assuming this message no)

endif.

Regards

Amole