10-15-2007 9:31 PM
Hi Experts,
Pls. clarify me the following,
Am working with BADI - MB_DOCUMENT_BADI (IF_EX_MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE),
So, I wanna to populate xmseg-sgtxt with my_value.
but, am getting an error saying that,
the xmseg can not/allowed be changed??
so,
1) is it really, not allowed to change it?
2) how to get done my requirement (with this badi)
3) if all r importing parmaters, like XMKPF; XMSEG, then wht is the use of this BADI?
actually, earlier i worked with BADI, which does hv the Exporting parametres?
thanq.
10-16-2007 3:35 PM
Hi,
Please try this.
DATA: T_XMKPF TYPE STANDARD TABLE OF MKPF,
WA_XMKPF TYPE MKPF,
T_XLIPS TYPE STANDARD TABLE OF LIPS,
WA_XLIPS TYPE LIPS.
FIELD-SYMBOLS: <XMKPF> TYPE ANY TABLE,
<XLIPS> TYPE ANY TABLE.
ASSIGN ('(SAPMM07M)XMKPF[]') TO <XMKPF>.
ASSIGN ('(SAPMM07M)X_LIPS[]') TO <XLIPS>.
T_XMKPF[] = <XMKPF>[].
T_XLIPS[] = <XLIPS>[].
READ TABLE T_XLIPS INDEX 1 INTO WA_XLIPS.
IF SY-SUBRC = 0.
LOOP AT T_XMKPF INTO WA_XMKPF.
WA_MKPF-XBLNR = WA_XLIPS-VBELN.
MODIFY T_XMKPF FROM WA_XMKPF.
ENDLOOP.
ENDIF.
UNASSIGN <XMKPF>.
UNASSIGN <XLIPS>.
Are you using transaction MB01?
Regards,
Ferry Lianto
10-15-2007 9:41 PM
Hi Srikhar,
It is not allowing you to change because XMSEG is an importing parameter.
Reagrds,
Reema.
10-15-2007 9:47 PM
thanq, ur correct.
but, curiuos to know, pls, clarify,
1)then Wht is the use of this BADI
2) why names it as UPDATE?
thanq.
10-15-2007 9:50 PM
Hi,
Try to use field-symbols.
FIELD-SYMBOLS: <XMKPF> TYPE XMKPF.
ASSIGN XMKPF TO <XMKPF>.
...
UNASSIGN <XMKPF>.
Regards,
Ferry Lianto
10-15-2007 10:00 PM
thanq,
this (ur earlier same) suggestion , is worked out for user exit, anyways, will try for badi also.
thanq.
10-15-2007 10:30 PM
i implemeted ur sugestion.
<b><i>FIELD-SYMBOLS: <XMKPF> TYPE ANY.
FIELD-SYMBOLS: <XLIPS_VBELN> TYPE ANY.
ASSIGN ('(SAPMV50A)XLIPS-VBELN') TO <XLIPS_VBELN>.
ASSIGN XMKPF TO <XMKPF>.
<XMKPF-XBLNR> = <XLIPS_VBELN>.
UNASSIGN <XMKPF>.</i></b>UNASSIGN <XLIPS_VBELN>.
am getting error like,
<b><i><XMKPF-XBLNR> is unknown</i></b>
pls. can u correct it.
thanq.
10-15-2007 11:00 PM
Hi,
Sorry ... I am not able to help you now (I am off from system).
But please try this ... perhaps it may help (found in other website).
FIELD-SYMBOLS: <XMKPF_XBLNR> TYPE ANY,
<XLIPS_VBELN> TYPE ANY
ASSIGN ('(SAPLMBWL)XMKPF-XBLNR') TO <XMKPF_XBLNR>.
ASSIGN ('(SAPMV50A)XLIPS-VBELN') TO <XLIPS_VBELN>.
<XMKPF_XBLNR> = <XLIPS_VBELN>.
UNASSIGN <XMKPF_XBLNR>.
UNASSIGN <XLIPS_VBELN>.
Regards,
Ferry Lianto
10-16-2007 4:20 AM
thanq,
When i executed ur code, am getting the Dump, saying that, am using the Filed symbol, with out assigning it!!
+-XBLNR.#######here dump
assign <XLIPS_VBELN> to <XMKPF_XBLNR> . #######here dump
*.
<XLIPS_VBELN> = <XMKPF>-XBLNR.#########dump
*endloop.
UNASSIGN + **********************************
I tried for 2 hours, with many options, but, always, the same!!
so, pls. culd u frame the code in a good executable way!!
I dont únderstand that weather am making wrong or SAP provided mseg/mkpf/badi in complicated manner!!
anyways, thanq
Message was edited by:
Srikhar
10-16-2007 4:28 AM
Hi Srikhar,
have you looked at the sample code of the BADI?
Regards,
Atish
10-16-2007 4:59 AM
Hi,
Try this code..
FIELD-SYMBOLS: <XMKPF_XBLNR> TYPE ANY,
<XLIPS_VBELN> TYPE ANY,
<XMKPF> TYPE MKPF.
ASSIGN ('(SAPLMBWL)XMKPF-XBLNR') TO <XMKPF_XBLNR>.
ASSIGN ('(SAPMV50A)XMKPF-XBLNR') TO <XMKPF_XBLNR>.
ASSIGN ('(SAPMV50A)XLIPS-VBELN') TO <XLIPS_VBELN>.
ASSIGN ('(SAPLMBWL)XMKPF') TO <XMKPF>.
<XMKPF>-XBLNR = <XLIPS_VBELN>.
UNASSIGN <XMKPF_XBLNR>.
UNASSIGN <XLIPS_VBELN>.
UNASSIGN <XMKPF>.
Thanks
Naren
10-16-2007 1:59 PM
thanq,
this term, the <xmfpf> is getting populating, but am getting the same dump(coz, the <XLIPS_VBELN> is NOT assigning/populating, more over, its getting red color in debugging-field entry) , at another point!! my code goes,( i tried diff. options),
<i><b>*ASSIGN ('(SAPLMBWL)XMKPF-XBLNR') TO <XMKPF_XBLNR>.
**ASSIGN ('(SAPMV50A)XMKPF-XBLNR') TO <XMKPF_XBLNR>.
**ASSIGN ('(SAPMV50A)XLIPS-VBELN') TO <XLIPS_VBELN>.
*ASSIGN ('(SAPLMBWL)XLIPS-VBELN') TO <XLIPS_VBELN>.
*
*ASSIGN ('(SAPLMBWL)XMKPF') TO <XMKPF>.
*
*<XMKPF>-XBLNR = <XLIPS_VBELN>.</b></i>
anyways, thanq.
Message was edited by:
Srikhar
10-16-2007 3:35 PM
Hi,
Please try this.
DATA: T_XMKPF TYPE STANDARD TABLE OF MKPF,
WA_XMKPF TYPE MKPF,
T_XLIPS TYPE STANDARD TABLE OF LIPS,
WA_XLIPS TYPE LIPS.
FIELD-SYMBOLS: <XMKPF> TYPE ANY TABLE,
<XLIPS> TYPE ANY TABLE.
ASSIGN ('(SAPMM07M)XMKPF[]') TO <XMKPF>.
ASSIGN ('(SAPMM07M)X_LIPS[]') TO <XLIPS>.
T_XMKPF[] = <XMKPF>[].
T_XLIPS[] = <XLIPS>[].
READ TABLE T_XLIPS INDEX 1 INTO WA_XLIPS.
IF SY-SUBRC = 0.
LOOP AT T_XMKPF INTO WA_XMKPF.
WA_MKPF-XBLNR = WA_XLIPS-VBELN.
MODIFY T_XMKPF FROM WA_XMKPF.
ENDLOOP.
ENDIF.
UNASSIGN <XMKPF>.
UNASSIGN <XLIPS>.
Are you using transaction MB01?
Regards,
Ferry Lianto
10-16-2007 5:10 PM
sorry in delay, am using MB1C, but u know,!! NOT directly..............
its comes from Workflow!!
will let u know, the result , after implementing ur latest code!!
10-16-2007 8:21 PM
thanq,
worked out, with little changes , like, populating XLIPS from another prog.
thanq.