01-17-2013 11:16 AM
Dear Expert,
I have a specific requirement while validating MIRO document while parking (posting no issue control is in place) , implemented a BADI name = 'INVOICE_UPDATE' , method = 'CHANGE_AT_SAVE' ; following is the ABAP code in order to get multiline PO references for further manupulating for required validation.
METHOD if_ex_invoice_update~change_at_save.
DATA: lv_drseg(15) TYPE c VALUE '(SAPLMR1M)DRSEG'.
FIELD-SYMBOLS: <fs_drseg> TYPE ANY TABLE.
ASSIGN (lv_drseg) TO <fs_drseg>.
IF <fs_drseg> IS ASSIGNED.
BREAK-POINT.
ENDIF.
ENDMETHOD.
I am getting a runtime error = 'ASSIGN_TYPE_CONFLICT', at line ASSIGN (lv_drseg) TO <fs_drseg>.
please guide how i am able to extract data from multiline for further analysis or is there any other solution to validate multiline during parking MIRO document.
01-18-2013 6:15 AM
Hii,
Why are you use field symbol assign reference of DRSEG to get multiline PO references instead of that you can use internal table TI_RSEG_NEW (Import Parameter) which contain your po line item put your logic (ex. loop or any) , for more detail put break point and see in debugger local variables -
01-17-2013 12:10 PM
Hi,
Replace type any table with type any.
look AT this for help.
http://scn.sap.com/thread/73404
Thanks
Gourav.
01-18-2013 4:19 AM
Dear Gaurav,
Thanks !
I have corrected code as instructed, but problem not yet resolved.
I am getting an error at line code "
DATA : itab TYPE TABLE OF drseg WITH HEADER LINE."
and not able to compile
Error message.
"Class Method IF_EX_INVOICE_UPDATE~CHANGE_AT_SAVE
Tables with headers are no longer supported in the OO context. "
Then I tried with a statement
"DATA : itab TYPE TABLE OF drseg INITIAL SIZE 0" ; code get compiled but throws a runtime dump GETWA_NOT_ASSIGNED - Field symbol has not yet been assigned.
01-18-2013 4:41 AM
01-18-2013 4:45 AM
Hi,
For ur OO context error look at this.
in OOPS ABAP,internal table with header area is obsolete.
http://scn.sap.com/thread/1025637
see what sap help said SOLUTION for this !!!
http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb36a1358411d1829f0000e829fbfe/content.htm
Thanks
Gourav.
01-18-2013 6:15 AM
Hii,
Why are you use field symbol assign reference of DRSEG to get multiline PO references instead of that you can use internal table TI_RSEG_NEW (Import Parameter) which contain your po line item put your logic (ex. loop or any) , for more detail put break point and see in debugger local variables -
01-18-2013 6:39 AM
Thanks Ashish, Surely I could have used this but TI_RSEG_NEW table does not show any records.
01-18-2013 6:51 AM
Hiii,
I don't know why data is not populating it may be due to other reason , but you can also use or
DATA: lv_drseg(20) TYPE c VALUE '(SAPLMR1M)YDRSEG[]'.
DATA: lv_drseg(20) TYPE c VALUE '(SAPLMR1M)T_DRSEG[]'.
01-18-2013 8:27 AM
01-18-2013 8:33 AM
01-18-2013 6:38 AM
Hi
Are you sure that the parameter (SAPLMR1M)DRSEG does exist and getting filled in program SAPLMR1M. I could see other table parameters like t_drseg, ydrseg, i drseg getting filled in program.
So probably it could be one of the parameters you need to get visibility by field symbols w.r.to structure
mmcr_drceg.
Try writing a logic as mentioned below and see if you are getting the error to understand the issue better.
DATA: lv_drseg(20) TYPE c VALUE '(SAPLMR1M)T_DRSEG'.
FIELD-SYMBOLS: <fs_drseg> TYPE ANY.
ASSIGN (lv_drseg) TO <fs_drseg>.
IF <fs_drseg> IS ASSIGNED.
BREAK-POINT.
ENDIF.
br...
Dwaraka.