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

ranges statement

Former Member
0 Likes
647

i hav created the table with following fields

MANDT

ZZSAKNR_F account from

ZZSAKNR_T account to

ZZPC_REQ

ZZCC_REQ

ZZSI_REQ

ZZCENTR_FROM

ZZCENTR_TO

ZZWBS_REQ

ZZORDER_REQ

now i hav to do validations as below

1) For an account number, both Profit Center required (ZZPC_REQ) and Cost Center require (ZZCC_REQ) can not be selected, if selected raise error message.

2) If the account is balance sheet (Can be determined from SKA1- XBILK), then if user to check u2018Cost Centeru2019 checkbox, raise error message u2018Cost centers can not be assigned to a balance sheet.

3) If an account is GL account, then one and only one checkbox u2018Profit center requiredu2019 or u2018Cost center requiredu2019 or u2018Order requiredu2019 or u2018WBS requiredu2019 should be checked.

for that i have to use ranges statement for account number to do validations on account from and account to .how to do that one?

please can any one send the code for this?

5 REPLIES 5
Read only

Former Member
0 Likes
628

How can we supply code if you don't have the code so far you are working on ?

have you build a screen with SE51 or a selection screen with SE38 ??

kind regards

arthur

Read only

0 Likes
628

wht he means to say is that he wants a ready-made code from sdn so he can spend his time staring listlessly at the computer-screen while others do his his leg work

pk

Read only

Former Member
0 Likes
628

Hi,

Why don't yuo try to figure it out for yourself? Start writing the code and then come back with any specific problems and ask for help instead of asking people to do your work for you?

Gareth.

Read only

0 Likes
628

RANGES: r_tab FOR zctf_as400intpro-zzsaknr_f.

  • IF NOT zctf_as400intpro-zzsaknr_f IS INITIAL.

  • IF NOT zctf_as400intpro-zzpc_req IS INITIAL

  • AND zctf_as400intpro-zzcc_req IS NOT INITIAL.

  • MESSAGE e012(zcfi01).

  • ENDIF.

  • ENDIF.

  • IF NOT zctf_as400intpro-zzsaknr_f IS INITIAL AND zctf_as400intpro-zzsaknr_t IS NOT INITIAL.

  • r_tab-sign = 'I'.

  • r_tab-option = 'BT'.

  • r_tab-high = zctf_as400intpro-zzsaknr_f.

  • r_tab-low = zctf_as400intpro-zzsaknr_t.

  • APPEND r_tab.

  • ELSEIF NOT zctf_as400intpro-zzsaknr_f IS INITIAL AND zctf_as400intpro-zzsaknr_t IS INITIAL.

  • r_tab-sign = 'I'.

  • r_tab-option = 'BT'.

  • r_tab-high = zctf_as400intpro-zzsaknr_f.

  • r_tab-low = ' '.

  • APPEND r_tab.

  • SELECT saknr

  • xbilk

  • FROM ska1

  • INTO TABLE lt_acc

  • WHERE saknr IN r_tab.

  • IF sy-subrc EQ 0 AND zctf_as400intpro-zzcc_req EQ 'X'.

  • MESSAGE e014(zcfi01).

  • ENDIF.

  • ENDIF.

*

  • IF NOT zctf_as400intpro-zzsaknr_f IS INITIAL AND zctf_as400intpro-zzsaknr_t IS NOT INITIAL.

  • r_tab-sign = 'I'.

  • r_tab-option = 'BT'.

  • r_tab-high = zctf_as400intpro-zzsaknr_f.

  • r_tab-low = zctf_as400intpro-zzsaknr_t.

  • APPEND r_tab.

  • ELSEIF NOT zctf_as400intpro-zzsaknr_f IS INITIAL AND zctf_as400intpro-zzsaknr_t IS INITIAL.

  • r_tab-sign = 'I'.

  • r_tab-option = 'BT'.

  • r_tab-high = zctf_as400intpro-zzsaknr_f.

  • r_tab-low = ' '.

  • APPEND r_tab.

  • SELECT saknr

  • xbilk

  • FROM ska1

  • INTO TABLE lt_acc

  • WHERE saknr IN r_tab.

  • IF sy-subrc EQ 0.

  • IF zctf_as400intpro-zzpc_req IS NOT INITIAL

  • OR zctf_as400intpro-zzcc_req IS NOT INITIAL

  • OR zctf_as400intpro-zzwbs_req IS NOT INITIAL

  • OR zctf_as400intpro-zzorder_req IS NOT INITIAL.

  • ELSE.

  • MESSAGE e015(zcfi01).

  • ENDIF.

  • ENDIF.

  • ENDIF.

Read only

0 Likes
628

i hav written the code above.i dont know how to use ranges?plz help me inthis.