09-24-2014 8:07 AM
Hi everyone,
I developped an LSMW to upload customers using DEBMAS06.
I've an issue because I have to create a customer and extend him to others sales organization but I don't know how to repeat a segment with its child segment. I used "transfer_record" on E1KNVVM and E1KNVIM but i have this:
E1KNVVM
E1KNVVM - E1KNVIM
- E1KNVIM
I want
E1KNVVM - E1KNVIM
E1KNVVM - E1KNVIM
Can you tell me if i can create and extend a customer in the same Idoc. If not, have you an idea about create a customer with one line of my source file and extend him with an other knowing you don't know what's your customer KUNNR before create him.
Scuse me for my english, I'm french and I don't speak very well.
Regards,
Lionel
10-02-2014 4:37 PM
09-24-2014 9:02 AM
First of all, when you are maintaining the field mapping, go to the menu ->extras -> Hide and display Field/codes. If you display "Processing time", you should be able to see at the end of every structure an _end_of_record_ field.
Modify the code to:
transfer_record
** Start of insertion **
E1KNVVM-VKORG = ... "your new sales order
E1KNVVM-VTWEG = ... "your new channel
E1KNVVM-SPART = .... "your new division
E1KNVVM-any_field = ... "your new values
transfer_record.
** End of insertion **
Be careful if you're mapping the child structure E1KNVIM otherwise there will be a sintax problem in the IDoc. In that case, you should do this insertion at the end of E1KNVIM.
If you want to learn more about LSMW, go to http://service.sap.com/lsmw -> Media Center
09-24-2014 11:05 AM
Hi Ivan,
I've this:
I did what you say:
If I put "transfer_record" under E1KNVV segment:
And the result is :
E1KNVVM- nothing
E1KNVVM- E1KNVIM
- E1KNVIM
When I put "transfer_record" under the child segment:
The result is:
I try to have :
E1KNVVM- E1KNVIM
E1KNVVM- E1KNVIM
I have to put E1KNVIM for each E1KNVVM segments.
09-24-2014 12:24 PM
Hi,
This is the structure that I want:
Please, someone can help me, it's very urgent...
Regards,
Lionel
09-24-2014 1:09 PM
You almost got it.
transfer_record is a macro that will insert a new segment in the IDoc.
You are calling twice it after the segment E1KNVIM has been populated, then you get two E1KNVIM segements in your IDoc.
You want that macro to populate E1KNVIM and then a new E1KNVVM, then change the global fields g_edidd_segnam, segnum and psgnum accordingly.
Exactly as what I see in the 4th picture you have attached... in the begin of record. Did you spot it?
09-24-2014 1:27 PM
09-24-2014 1:46 PM
1. Set the fields _BEGIN_OF_RECORD_ and _END_OF_RECORD_ in segment E1KNVVM back to default settings.
2. Set the fields _BEGIN_OF_RECORD_ in segment E1KNVIM back to default settings.
3. Change the code in _END_OF_RECORD_ in segment E1KNVIM to this:
transfer_record. "It will create a E1KNVIM segment for the 1st sales area.
** insert **
g_edidd_segnam = 'E2KNVVM007'.
g_edidd_segnum = '0005'.
g_edidd_psgnum = '000001'.
g_edidd_hlevel = '02'.
E1KNVVM-VKORG = new_vkorg
E1KNVVM-VTWEG = new_vtweg
E1KNVVM-SPART = new_spart
transfer_record "it will create a E1KNVVM segment for the 2nd sale area.
g_edidd_segnam = 'E2KNVIM'.
g_edidd_segnum = '0008'
g_edidd_psgnum = '000005'
g_edidd_hlevel = '03'
E1KNVIM-any_field = new_field "if something needs to be changed
transfer_record "it will create a E1KNVIM
Bye!
09-24-2014 3:16 PM
I did what you said and litlle more, at the end of E1KNVIM, I put this code:
transfer_record.
g_edidd_segnam = 'E2KNVVM007'.
g_edidd_segnum = '0005'.
g_edidd_psgnum = '000001'.
g_edidd_hlevel = '02'.
E1KNVVM-MSGFN = DEBMAS2-MSGFN.
E1KNVVM-VKORG = DEBMAS2-VKORG2.
E1KNVVM-VTWEG = DEBMAS2-VTWEG2.
E1KNVVM-SPART = DEBMAS2-SPART2.
E1KNVVM-KALKS = '1'.
E1KNVVM-KONDA = '02'.
E1KNVVM-VSBED = '01'.
E1KNVVM-WAERS = DEBMAS2-WAERS.
E1KNVVM-ZTERM = '0001'.
transfer_record.
g_edidd_segnam = 'E2KNVIM'.
g_edidd_segnum = '0008'.
g_edidd_psgnum = '000005'.
g_edidd_hlevel = '04'.
E1KNVIM-MSGFN = DEBMAS2-MSGFN.
E1KNVIM-ALAND = 'FR'.
E1KNVIM-TATYP = 'MWST'.
E1KNVIM-TAXKD = '1'.
transfer_record.
It creates a new E1KNVVM segment but with an E1KNVIM structure and records...
Here is the result:
09-25-2014 9:00 AM
I forgot :
g_record = '....'.
before :
g_edidd_segnam = '....'.
So now it's working but I've a new issue, with one E1KNVVM segment, my idoc is ok but with two, I've the status 51 with this message : All fields required : SAPMF02D 0111 ADDR1_DATA-NAME1
Can you help me on this please ?
10-02-2014 4:37 PM
10-03-2014 8:20 AM