‎2007 Aug 23 1:06 AM
Hi Gurus,
I have to write a RFC Function Module...I have written the code for that...please review it and tell me if this is fine...
TABLES: ZTFICO_GL_ITY_MP......?can i use it like this...
DATA: B_RESULT TYPE c.
SELECT SINGLE * FROM ZTFICO_GL_ITY_MP WHERE ZZITY = BSEG-ZZITY
AND HKONT = BSEG-HKONT
AND END_DT > BKPF-BUDAT.
IF SY-SUBRC <> 0.
B_RESULT = B_FALSE.
MESSAGE E033(ygrfxx) WITH BSEG-ZZITY BSEG-HKONT BKPF-BUDAT.
ENDIF.
ENDFUNCTION.
Please give suggestions...Points will be rewarded..
Cheers: Sam
‎2007 Aug 23 1:10 AM
‎2007 Aug 23 1:10 AM
‎2007 Aug 23 1:12 AM
Thanks for the reply....then how can i do this....please suggest...
Cheers:Sam
‎2007 Aug 23 1:13 AM
‎2007 Aug 23 1:18 AM
Ho can i do it...i am new to this...can u help me with the code or provide steps to do it...
also can i declare tables in the RFC FM the way i have done....
Cheers:
sam
‎2007 Aug 23 1:27 AM
Hi,
For Exceptions
SE37--> after giving fm name > change> choose exceptions tab-->enter MATERIAL_NOT_FOUND then in description enter Material not found
In code
instead of
MESSAGE E033(ygrfxx) WITH BSEG-ZZITY BSEG-HKONT BKPF-BUDAT.
write as
raise exception MATERIAL_NOT_FOUND
If you want to send the your message out then insert a RETURN table in the Tables Tab
and fill it with your message.
Tables declaration:-->
You can declare but in the TOP include of the main program.
aRs
‎2007 Aug 23 4:58 PM
How can i insert the return table and send messages out...can u provide some sample code....
Kindly help...
Cheers: Sam
‎2007 Aug 23 5:10 PM
Hi,
Insert BAPIRET1 as RETURN table in function module Tables Tab
then
data : begin of bapireturn occurs 0.
include structure bapiret1.
data : end of bapireturn.
clear bapireturn.
process field return-type.
bapireturn-type = type.
process field id, number
bapireturn-id = cl.
bapireturn-number = number.
process message variables
bapireturn-message_v1 = par1.
bapireturn-message_v2 = par2.
bapireturn-message_v3 = par3.
bapireturn-message_v4 = par4.
append bapireturn.
please check fm APAR_EBPP_DELETE_BANK
aRs