Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

IF_EX_MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

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

13 REPLIES 13

former_member189058
Active Contributor
0 Kudos

Hi Srikhar,

It is not allowing you to change because XMSEG is an importing parameter.

Reagrds,

Reema.

0 Kudos

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.

ferry_lianto
Active Contributor
0 Kudos

Hi,

Try to use field-symbols.


FIELD-SYMBOLS: <XMKPF> TYPE  XMKPF.
 
ASSIGN XMKPF TO <XMKPF>.

...

UNASSIGN <XMKPF>.

Regards,

Ferry Lianto

0 Kudos

thanq,

this (ur earlier same) suggestion , is worked out for user exit, anyways, will try for badi also.

thanq.

0 Kudos

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.

ferry_lianto
Active Contributor
0 Kudos

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

0 Kudos

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

0 Kudos

Hi Srikhar,

have you looked at the sample code of the BADI?

Regards,

Atish

Former Member
0 Kudos

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

0 Kudos

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

ferry_lianto
Active Contributor
0 Kudos

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

0 Kudos

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!!

0 Kudos

thanq,

worked out, with little changes , like, populating XLIPS from another prog.

thanq.