cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Documents And Attachments

Former Member
0 Kudos

Dear Friends,

We are implementing SRM 5.0 and i am facing problem with 'Documents And Attachments' tab of shopping cart. I am trying to send 'Alternate Address' from BSP application to the shopping cart as a Text in Documents And Attachments. To transfer this data to BBP_CATALOG_TRANSFER badi i am making use of NEW_ITEM-LONGTEXT_n:132[] field.

I have created a new TextID in SPRO as 'ZADD'. In BBP_DOC_CHANGE_BADI i'm changinging CT_LONGTEXT-TDID from ITXT(text id for Vendor Text and is a default value of TDID in CT_LONGTEXT) to ZADD(Alternate Address). Doing this, i am able to see the data in 'Text preview' of Documents And Attachment against Alternate Address but when i click on the Alternate Address link the data disappears from the preview and also is not displayed in the text area below.

Kindly let me know if i have missed out any step and the correct way of achieving it.

Regards,

B.Siddhesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Debug the DOC_CHANGE_BADI - it is running a few times for each shopping cart, probably your ZADD gets deleted in the following call to the DOC_CHANGE_BADI.

Add a check to see if the ZADD already exists, if so, skip the code to change ITXT to ZADD.

Something like:


READ TABLE ct_longtext TRANSPORTING NO FIELDS WITH KEY tdid EQ 'ZADD'.
IF sy-subrc NE 0. "no entry for ZADD yet, so execute the code.
  LOOP AT ct_longtext INTO ls_longtext WHERE tdid EQ 'ITXT'.
    MOVE 'ZADD' TO ls_longtext-tdid.
    MODIFY ct_longtext FROM ls_longtext.
  ENDLOOP.
ENDIF.

note that ANY vendor text is now changed to the alternate address.

Regards,

Robin

Former Member
0 Kudos

Hi Robin,

Thanks a lot for your prompt response.

Before my code was something this,


LOOP AT ct_longtext INTO wa_longtext.
      wa_longtext-tdid = 'ZADD'.
      MODIFY ct_longtext FROM wa_longtext INDEX sy-tabix TRANSPORTING tdid.
ENDLOOP.

Then i followed your suggestion in this way,


LOOP AT ct_longtext INTO wa_longtext WHERE tdid EQ 'ITXT' AND counter NE '00000'.
      wa_longtext-tdid = 'ZADD'.
      MODIFY ct_longtext FROM wa_longtext INDEX sy-tabix TRANSPORTING tdid.
ENDLOOP.

And it resolved my problem.

Basically what used to happen before is the Vendor Text would be selected by default. When I click on any other link for e.g. Alternate Address the program calls BBP_DOC_CHANGE_BADI with textid in CT_LONGTEXT as ITXT but without any data and counter as '00000'. My code used to modify ITXT with ZADD because of which the data was getting lost. After making changes suggested by you

the data is getting displayed in the textarea as well as in the text preview of Documents and Attachments tab.

Thanks a lot once again. Full points...

Answers (0)