09-13-2011 5:18 AM
Hi
My Function module returns below Message structure for Warning or error.
Export parameter
ZMESSAGE TYPE ZXXXMESSAGE
Under ZXXXMESSAGE Line data type ZYYYMESSAGE is declared
ZYYYMESSAGE has below fields
-
LINE_NO
MSG_TYPE
MSG_ID
MSG_NO
MSGTEXT
MSG_V1
MSG_V2
MSG_V3
MSG_V4
ERROR_CODE
-
I declared as below and used but not working
L_ITAB_MESSAGE TYPE STANDARD TABLE OF ZXXXMESSAGE,
L_FLD_MESSAGE TYPE ZXXXMESSAGE,
CALL FUNCTION 'ZXXXXXXXXXX'
EXPORTING
F_IP_BUKRS = L_V_BUKRS
IMPORTING
F_EP_MESSAGE = L_ITAB_MESSAGE
CASE sy-subrc.
WHEN 0.
IF L_ITAB_MESSAGE IS NOT INITIAL.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
ARBGB = L_SY_MSGID
EXCEPTION_IF_NOT_ACTIVE = 'X'
MSGTY = L_ITAB_MESSAGE-MSG_TYPE
MSGV1 = L_ITAB_MESSAGE-MSG_V1
MSGV2 = L_ITAB_MESSAGE-MSG_V2
MSGV3 = L_ITAB_MESSAGE-MSG_V3
MSGV4 = L_ITAB_MESSAGE-MSG_V4
TXTNR = L_ITAB_MESSAGE-MSG_NO
ENDIF.
But it says L_ITAB is not data line type and no header for table.
Can you pls confirm should i have to give L_FLD_MESSAGE in MEssage_store FM?
Regards
chandra
09-13-2011 5:42 AM
Hi
L_ITAB_MESSAGE TYPE STANDARD TABLE OF ZXXXMESSAGE,
This is internal table not work area.
IMPORTING
F_EP_MESSAGE = L_ITAB_MESSAGE
Instead of L_ITAB_MESSAGE use L_FLD_MESSAGE.
Regards,
Surya
09-13-2011 5:42 AM
Hi
L_ITAB_MESSAGE TYPE STANDARD TABLE OF ZXXXMESSAGE,
This is internal table not work area.
IMPORTING
F_EP_MESSAGE = L_ITAB_MESSAGE
Instead of L_ITAB_MESSAGE use L_FLD_MESSAGE.
Regards,
Surya
09-13-2011 5:59 AM
Hello surya
thanks for your reply.
I am trying this but says error
"L_FLD_MESSAGE is not header line table so does not have MSGID component.
CALL FUNCTION 'MESSAGE_STORE'
EXPORTING
ARBGB = L_FLD_MESSAGE-MSG_ID
Pls advice.
Regards
Chandra
09-13-2011 6:16 AM
Hi chandra,
Declere Work area as
L_FLD_MESSAGE TYPE ZYYYMESSAGE
Regards,
Surya
09-13-2011 6:16 AM
Hi,
Please make sure you are passing values to a variable or a field of a work area.
As the message says, the "L_FLD_MESSAGE doesn't have a header line.
You need to declare "L_FLD_MESSAGE as a structure/work area and then pass the value.Or pass it to a variable of type arbgb.
09-13-2011 6:20 AM
Hi,
L_FLD_MESSAGE should be of type ZYYYMESSAGE as this is the line type.
Regards,
Archna
09-13-2011 6:57 AM
Hi
Sorry guys, I am not able understand..
let me put the code here
DATA
L_ITAB_SIIRESEIKYU TYPE STANDARD TABLE OF ZSXXRESEIKYU,
L_FLD_SIIRESEIKYU TYPE ZSXXRESEIKYU.
L_FLD_SIIRESEIKYU-DUNSNR = 'X'.
L_FLD_SIIRESEIKYU-BUDAT = BKPF-BUDAT.
L_FLD_SIIRESEIKYU-LIFNR = BSEG-LIFNR.
L_FLD_SIIRESEIKYU-XREF1 = BSEG-XREF1.
CALL FUNCTION 'ZXXXXX'
EXPORTING
F_IP_BUKRS = L_V_BUKRS
F_IP_CHK_SIIRESEIKYU = L_ITAB_SIIRESEIKYU
IMPORTING
F_EP_CHK_SIIRESEIKYU = L_ITAB_TIIRESEIKYU
F_EP_MESSAGE = L_ITAB_FIT_MESSAGE
Export parameter
F_IP_CHK_SIIRESEIKYU TYPE ZSIIRESEIKYU(it has Line type ZSXXRESEIKYU with fields DUNSNR<BUDAT,LIFNR,XREF1)
Now my confirmation is below stmt is correct?
F_IP_CHK_SIIRESEIKYU = L_ITAB_SIIRESEIKYU
Its giving dump now in FM but no syntax error.
Pls advice.
09-13-2011 7:07 AM
Hi
What is the message when getting DUMP.
Did you appended L_FLD_SIIRESEIKYU to L_ITAB_SIIRESEIKYU. Try
Append L_FLD_SIIRESEIKYU to L_ITAB_SIIRESEIKYU.
Regards,
Surya
09-13-2011 7:17 AM
HI
Before appending itgives below error
It says L_FLD_SIIRESEIKYU is a table without header line and therefore has no component called DUNSNR.
Regards
09-13-2011 7:23 AM
09-13-2011 7:27 AM
Hi surya
it works with line type
But i cannot append it.
it says L_FLD_SIIRESEIKYU cannot be converted to line type of L_Itab_SHIIRESEIKYU.
Regards
Chandra
09-13-2011 7:32 AM
09-13-2011 8:00 AM
Hi Surya
Thanks for support
It works now and one last question
L_FLD_FIT_MESSAGE has error message now. which is the bestway to display it?
Regards
Chandra
09-13-2011 8:13 AM
Hi Chandra,
That is your wish or Download to the presentation server.
If it solved Change the status as Answered.
Regrds,
Surya.
09-13-2011 9:02 AM
Hi surya
thanks for your reply.
I have rewarded points and let me close it.
Regards