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

function module to validate posting date

Former Member
0 Likes
1,070

Hi all,

i am using function module amfi_period_get_and_check to validate posting date.

if posting date is not open this module raises error message but when i am using it

in my code its not showing error message but when i am executing the module

it is showing the message for the same date

please reply soon

thnx

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
788

take the function module from the pattern and check sy-subrc <> 0 and give the message.

when you take a function module from pattern it also codes the if sy-subrc <>0.

endif .within that there is message statement just uncomment that .

Please reward if useful.

5 REPLIES 5
Read only

Former Member
0 Likes
789

take the function module from the pattern and check sy-subrc <> 0 and give the message.

when you take a function module from pattern it also codes the if sy-subrc <>0.

endif .within that there is message statement just uncomment that .

Please reward if useful.

Read only

0 Likes
788

i have already uncommented that but it shud be <> 0 in order to raise the

message but it is coming = 0.

Read only

0 Likes
788

can u show the code??

Read only

0 Likes
788

at selection-screen on pos_dt.

CALL FUNCTION 'AMFI_PERIOD_GET_AND_CHECK'

EXPORTING

i_bukrs = com_code-low

  • I_GJAHR =

i_koart = 's'

  • I_KONTO = ' '

I_MONAT = '00'

I_BUDAT = pos_dt.

  • IMPORTING

  • E_MONAT =

  • E_GJAHR =

  • EXCEPTIONS

  • ERROR_PERIOD = 1

  • ERROR_PERIOD_ACC = 2

  • OTHERS = 3

  • .

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

0 Likes
788
one clarification...

should'nt i_koart be in upper case??

CALL FUNCTION 'AMFI_PERIOD_GET_AND_CHECK'
EXPORTING
i_bukrs = com_code-low
* I_GJAHR =
i_koart = 'S'         " in upper case