2011 Jun 06 12:15 PM
Hi Friends,
After executing a FM HR_MAINTAIN_MASTERDATA to modify APPLICANT master data of 0015, there is nothing in return means "success". But in the status bar it is showing a message "No data stored for Additional Payments(0015) in the selected period",Message no. PG009. the problem is: here i am checking the RETURN1 table which is showing a success. but i want to capture that status bar mesage. I have spent almost half a day but i didnt get how to capture that std msg. plz help me out..
Thanks in Advance,
Friend of all...
Moderator message: please choose more descriptive subject lines for your posts.
Edited by: Thomas Zloch on Jun 6, 2011 1:44 PM
Hi Friends,
After executing a FM HR_MAINTAIN_MASTERDATA to modify APPLICANT master data of 0015, there is nothing in return means "success". But in the status bar it is showing a message "No data stored for Additional Payments(0015) in the selected period",Message no. PG009. the problem is: here i am checking the RETURN1 table which is showing a success. but i want to capture that status bar mesage. I have spent almost half a day but i didnt get how to capture that std msg. plz help me out..
Thanks in Advance,
Friend of all...
Moderator message: please choose more descriptive subject lines for your posts.
Edited by: Thomas Zloch on Jun 6, 2011 1:44 PM
2011 Jun 06 12:42 PM
Can you please check transparent table PB0015 for the applicant you created a record?
If there is an infotype record available in the table then change the selection period to "ALL" and check.
Cheers,
Rupesh
2011 Jun 06 12:44 PM
Hi.,
May be you can use FM Format_Message .,
call this FM after HR_MAINTAIN_MASTER_DATA FM.,
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = 'E'
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = LV_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2hope this helps u.,
Thanks & Regards,
Kiran
2011 Jun 06 1:23 PM
Hi Kiran,
Thanx a lot, My problem is solved. But i need some clarification here. How can u get to know that whether that message is of type E or I or W or A. however i check that, for type S LV_MSG is empty and for other types? I am diplaying in ALV the type of message also with corresponding text. can u give me clarification regarding this..And even it is capturing still msg is diaplaying in the status bar..how can i avoid that...
Thanks & Regards,
Sai kiran...
Edited by: friendofall on Jun 6, 2011 5:54 PM
2011 Jun 06 2:13 PM
Hi.,
Use BDCMSGCOLL Structure to capture messages and store in internal table.,
In that MSGTYP field holds type of message.
You loop the internal table.
if MSGTYP = 'S'.
do success
else if MSGTYP = 'E'.
process error.
hope this helps u.,
Thanks & Regards,
Kiran
2011 Jun 07 6:11 AM
Hi Kiran,
Where can i use BDCMSGCOL table in the code below..I dnt know how it is managing to read the msg with the help of FORMAT_MESSAGE FM,but it solved my problem..but i am unable to find the MSGTYP here.Plz tell me the logic how it is working(FORMAT_MESSAGE) and also where to use BDCMSGCOL table.And also tell me how to avoid the message into the status bar even though it is capturing by FORMAT_MESSAGE. Help me to close this issue completely..
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = PERNR
ACTIO = OPR
TCLAS = APPLICANT
BEGDA = BEGDA
ENDDA = ENDDA
SUBTY = SUBTT
DIALOG_MODE = P_DIA
LUW_MODE = '2'
NO_EXISTENCE_CHECK = ' '
NO_ENQUEUE = ' '
IMPORTING
RETURN1 = RET2
TABLES
PROPOSED_VALUES = P_VALUE.
2011 Jun 07 6:44 AM
Hi,
You can check the value return in structure RET2. It having fields name TYPE contain value S-Success, E-Error, W-Warning, I-Info, A-Abort.
While using function module FORMAT_MESSAGE generate the message but you can not define message type.
We can decide which type of message only on fields value of RET2-TYPE in your case.
You can write the message to display error according the message
if RET2-type is not initial.
MESSAGE ID RET2-LOG_NO TYPE RET-TYPE NUMBER RET2-LOG_MSG_NO
WITH RET2-MESSAGE_V1 RET2-MESSAGE_V2 RET2-MESSAGE_V3 RET2-MESSAGE_V4.
endif.
2011 Jun 07 7:16 AM
Hi Experts,
Please help me out. till now i have tried in many ways but not succeeded.
Actually this issue is regarding to capture the message which is not returning from the RETURN1 parameter but still displaying in the ALV status bar(check the first thread). But the RETURN1 parameter is coming empty which means no Errors. So m considering this as a success and displaying a success message in the ALV, where in the ALV's Status bar still it is showing that std msg.
I overcome this with the help of format_message FM suggested by kiran.
this is my code..
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
PERNR = PERNR
ACTIO = OPR
TCLAS = APPLICANT
BEGDA = BEGDA
ENDDA = ENDDA
SUBTY = SUBTT
DIALOG_MODE = P_DIA
LUW_MODE = '2'
NO_EXISTENCE_CHECK = ' '
NO_ENQUEUE = ' '
IMPORTING
RETURN1 = RET2
TABLES
PROPOSED_VALUES = P_VALUE.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = 'E'
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = LV_MSG
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2.Here i need some clarification:
1. how the FM format_message manages to capture that std msg which is not even able to capture by HR_MAINTAIN_MASTERDATA?
2. Though i overcame the problem, still that std msg is diaplaying in the ALV status bar.How can i avoid this?
3. Where can i find the msgtype in the HR_MAINTAIN_MASTERDATA exporting parameters since it is not returning any value?
The answers for these 3 questions will be really appreciable..if possible plz provide me a sample code.
Thanks in advance...
Sai Kiran...
Edited by: friendofall on Jun 8, 2011 1:49 PM
2011 Jun 08 9:40 AM
Hi,
There are 2 more oarameter other than RETURN1.
You have to check what is value is coming in RETURN and HR_RETURN also.
If that error message is not coming in other parameter debug the program and find where actual error message.
It rise the exeception and it is not handle in that function module you have to make copy of function moudle in z and correction to hanlde the error message or alternativly you can also find sap note for it.
Kind Rgds
Ravi Lanjewar