cancel
Showing results for 
Search instead for 
Did you mean: 

Can we delete Text Log in an Opportunity

Former Member
0 Kudos

Hi,

Can we delete text logs in an opportunity?

If yes, please guide me with the steps.

Regards,

Sayan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sayan/Anji,

To delete the log, you have to delete the text type for which the log has been maintained , i.e. Text type 'P'. This will delete Text type 'R' automatically.

data:  lv_transaction_id TYPE  crmt_object_id,

          lv_guid TYPE crmt_object_guid,

          lv_tdname TYPE string,

          lt_data TYPE TABLE OF stxl,

          ls_stxl TYPE stxl.

lv_transaction_id = 'your transaction id/opportunity id /sales order id '.

SELECT SINGLE guid FROM crmd_orderadm_h INTO lv_guid WHERE object_id =      lv_transaction_id.

lv_tdname = lv_guid.

CONCATENATE lv_tdname '%' INTO lv_tdname.

SELECT * FROM stxl INTO TABLE lt_data WHERE tdname LIKE lv_tdname

             AND tdid = 'ZABC'.   "tdid of text type 'P'

LOOP AT lt_data INTO ls_stxl.

    DELETE FROM  stxl CLIENT SPECIFIED

           WHERE relid     =  'TX'

             AND mandt      =   sy-mandt

             AND tdobject  =   ls_stxl-tdobject

             AND tdname   =   ls_stxl-tdname

             AND tdid         =   ls_stxl-tdid

             AND tdspras  =   ls_stxl-tdspras.

ENDLOOP.

former_member182421
Active Contributor
0 Kudos

Recommending to delete entries on a standard table directly is not the best advice, don' you think?

faisal_pc
Active Contributor
0 Kudos

Hi Luis,

Same here. That even inside a loop.

What about the FM CRM_TEXT_MAINTAIN_OW or CRM_OPPORT_TEXT_MAINTAIN_OW(I haven't used yet though).

Thanks,

Faisal

former_member182421
Active Contributor
0 Kudos

wel...that's what I suggested on the very beginning, us the CRM_ORDER_MAINTAIN...but as usuall the OP didn't follow his own threat...

Former Member
0 Kudos

Thank you Luis.

Its a one time activity so I have used DELETE_TEXT function module.

Thank you

Anji

former_member182421
Active Contributor
0 Kudos

Well Anji Reddy, thanks for your feedback unfortunately you are not the OP, but I'm glad that even without been the OP you show some concerns on this discussion

Former Member
0 Kudos

Hi Sayan,

Are you able to delete the Text type "Log". I too want to delete the text type "Log". But couldnt find this in Text (STXH/STXL) tables.

Thank you

Anji

former_member182421
Active Contributor
0 Kudos

Yes you can delete them as long as you have the authorization to do it

I guess you mean by program, in that case I would suggest to put a break point in the FM CRM_ORDER_MAINTAIN, delete the text from WebUI or SAP GUI (CRMD_ORDER), and check the input parameters, once you got how it works, use CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE in your custom program, if your scenario is more specific, will be a great if you describe it more precisely.

Cheers!

Luis

Former Member
0 Kudos

Thanks Luis for your reply.

Earlier we had to add a note to few opportunities, so we added that through a custom report using the FM CRM_ORDER_MAINTAIN. The note was not added as a row item in the notes assignment block, rather the Text Log was updated.

Text Log is maintained as type R(Display Log) and hence can't be modified.

Now we have a requirement to delete the note we have added earlier. Since we don't have any row item specific to the note we added earlier, we are not sure how we should go about it.

former_member182421
Active Contributor
0 Kudos

Sorry I don't get it, you mean you can delete the Text online? Can you paste some screenshots?