‎2011 Feb 11 2:47 AM
Hello Experts,
I am creating an Info Record in ME11 by uploading data from excel sheet.
First I fetch data from excel sheet to int table, then int table to ME11 via BDC Call Transaction.
Everything was working fine untill now sicne I encoutered this new situation.
Lets say I have to enter textline in some fileds like Infopath in my case, if all there is no text present already and I am setting data in the fields from my XLS only than its ok but if there are already entries present in that case my recording is appending new lines above theold text but I want them below the old text.
Please guide me.
‎2011 Feb 11 10:31 AM
Hi,
My understanding from you is ,You want to append an entry in the Info Record note and when an entry is already existing your value overwrites the entry.I noted that the first line's fieldname is 'ltext1' and for the second is 'ltext2' ,...you can try putting the perform bdc_field for that particular field(ltext1) inside an if statement like...
If table-ltext1 ne ' '.
perform bdc_field using 'table-ltext1' 'aaaaaa'.
else.
perform bdc_field using 'table-ltext2' 'bbbbbb'.
endif.
Kindly ignore if not useful or incorrect.
Thank You.
‎2011 Feb 11 6:47 AM
Hi aamreta
Not sure I understand the problem, but here's 2 things worth a mention. If you're entering data repetitively in BDCs I usually do a page down as first step and then I fill line 2. This always appends the new record instead of inserting. Another thing worth a mention is that if you have no data to fill a field, use standard BDC NO_DATA field == '/'.
I hope this is useful. Best regards, Adrian
‎2011 Feb 11 7:10 AM
Hi,
I have done this recording in ME11 for creating info record earlier,can you please be clear on which field you are appending and your requirement.
With Regards,
Shanmugam
‎2011 Feb 11 9:31 AM
Hello,
I am doing this for Info Record note & Purchase Order Text.
Please guide me.
‎2011 Feb 11 9:37 AM
Hi,
you need to do BDC for multiple entires.. in your case you have done for single entry thats why the values are over written..Adrian's suggestion is correct.
Regards,
Nagaraj
‎2011 Feb 11 10:31 AM
Hi,
My understanding from you is ,You want to append an entry in the Info Record note and when an entry is already existing your value overwrites the entry.I noted that the first line's fieldname is 'ltext1' and for the second is 'ltext2' ,...you can try putting the perform bdc_field for that particular field(ltext1) inside an if statement like...
If table-ltext1 ne ' '.
perform bdc_field using 'table-ltext1' 'aaaaaa'.
else.
perform bdc_field using 'table-ltext2' 'bbbbbb'.
endif.
Kindly ignore if not useful or incorrect.
Thank You.
‎2011 Feb 11 5:43 PM
I had a program which did something similar using BDC and I got fed up with such problems after a few changes and after an upgrade (which totally changed the screens). I ended up re-writing the program to populate an INFREC IDOC and processing it using the IDOC_INPUT_INFREC function module.
‎2011 Feb 14 11:22 AM
Hello Experts,
I appreciate your responses but my problem has been resolved in other way.
I need to put value in Inforecord and if the value already exist then my value should get appended in bottom else it should be inserted from first line.
Now for this i made a func call for READ_TEXT:
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = 'AT'
language = 'EN'
name = ''
object = 'EINA'
TABLES
lines = it_lines1[].
DESCRIBE TABLE it_lines1 LINES idx1.then in BDC,, I have done:
v_len = STRLEN( wa_upload-txtline1 ). "since only 71 char are allowed
count = ( v_len / 71 ) + 1.
DO count TIMES. "no of lines form of 71 or less chars
PERFORM bdc_dynpro USING 'SAPLSTXX' '1100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RSTXT-TXLINE'.
v_len = STRLEN( wa_upload-txtline1 ).
IF v_len > 71.
v_txt1 = wa_upload-txtline1+(71).
wa_upload-txtline1 = wa_upload-txtline1+71(). "first line of text and all lines in middle have fval = EDNP
PERFORM bdc_field USING 'BDC_OKCODE'
'=EDNP'.
ELSE.
v_txt1 = wa_upload-txtline1.
PERFORM bdc_field USING 'BDC_OKCODE' "Last line of text have fval = TXBA
'=TXBA'.
ENDIF.
idx1 = idx1 + 1.
IF cnt <= 9.
CONCATENATE 'RSTXT-TXLINE' '(0' idx1 ')' INTO v_fname. " this will set the fnam eq to fieldname(line no) for
ELSE. " line no <= 9
CONCATENATE 'RSTXT-TXLINE' '(' idx1 ')' INTO v_fname. " this will set the fnam eq to fieldname(line no) for
ENDIF. " line no <= 9
PERFORM bdc_field USING v_fname
v_txt1.
ENDDO.Hope this will help you as well.
Edited by: aamreta on Feb 14, 2011 12:23 PM