hi Rohan,
do you have examples of idoc where this is done 'right'?
as Mike said, seems not to be a critical thing, but of course it is better to do ths correct!
kind regards,
henk-jan
On 06/24/2013 04:56 AM, Rohan wrote:
> Hi Guys,
>
> I have been creating a json to idoc mapping and it has all been going well.
>
> However, today I noticed that the automatically created "HLEVEL" was starting one number too high.
>
> I looked in the BOTS code and found the following in outmessage.py (458):
>
> if self.ta_info['automaticcount']:
> noderecord.update({'MANDT':self.ta_info['MANDT'],'DOCNUM':self.ta_info['DOCNUM'],'SEGNUM':str(self.recordnumber),'PSGNUM':str(headerrecordnumber),'HLEVEL':*str(len(structure_record[MPATH])*)})
>
> I found that if I simply subtracted one from the len() calculation it would give the correct result:
>
> if self.ta_info['automaticcount']:
> noderecord.update({'MANDT':self.ta_info['MANDT'],'DOCNUM':self.ta_info['DOCNUM'],'SEGNUM':str(self.recordnumber),'PSGNUM':str(headerrecordnumber),'HLEVEL':*str(len(structure_record[MPATH])-1)*})
>
> Perhaps this has to do with the fact that the "EDI_DC40" record is not the first level?
>
> The following is the output *before *the code change:
>
> EDI_DC40 3000000000000000013701 3012 MBGMCR03 MGBMCR MGBMCRGXS LILFY55231 SAPTS2 LS TS2CLNT500 20130624121419
> E2MBGMCR000 3000000000000000013000001000001*02*
> E2BP2017_GM_HEAD_01003 3000000000000000013000002000002*03*201306242013062413
> E2BP2017_GM_CODE000 3000000000000000013000003000003*03*04
>
> And the following is output *after *the code change:
>
> EDI_DC40 3000000000000000018701 3012 MBGMCR03 MGBMCR MGBMCRGXS LILFY55231 SAPTS2 LS TS2CLNT500 20130624122702
> E2MBGMCR000 3000000000000000018000001000001*01*
> E2BP2017_GM_HEAD_01003 3000000000000000018000002000002*02*201306242013062418
> E2BP2017_GM_CODE000 3000000000000000018000003000003*02*04
>
> So my question is, am I doing something wrong that is causing the HLEVEL to start one step too high? Or is the change I have done the correct fix?
>
> Thanks in advance,
> Rohan.
> --
> You received this message because you are subscribed to the Google Groups "Bots Open Source EDI Translator" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
botsmail+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>