Sales order Userexit to copy item text from one line item to other

Hi Gurus,
             I have an urgent issue. Based on item category in sales order, for one line item, I am getting item text. Now I have to copy same item text to other line item.
Till now I tried save_document_prep & save_document to
build object tdname & fetch all tdid from table stxh for object 'VBBP'.
After that READ_TEXT and SAVE_TEXT function module.
But during creation of sales order I am not able to get any value in STXH table for created sales order. Now I want to know from which internal table I can get item text ?  (some internal table should be there like xvbap to get text per line item)
Or is there any other way to do this... Please help.
Points will be rewarded.
Thanks,

Hi ,
try something like this .
        l_name = ls_vbap-vbeln.
        IF l_name IS INITIAL.
          l_name = 'XXXXXXXXXX'.
        ENDIF.
        CONCATENATE l_name ls_vbap-posnr INTO l_name.
        CALL FUNCTION 'READ_TEXT'
            name            = l_name
Regards
Prabhu

Similar Messages

  • Copy static text from one MIF documents to other MIF document

    Hi All,
    I'm trying to copy the text frames and their contents from one document to other document.
    I"m following the bellow steps..!
    1. Open Template1.mif by F_ApiSimpleOpen()
    2. Create new document called "Template2.mif" using "F_ApiCustomDoc"
    3. Import the required formats by
    F_ApiSimpleImportFormats(Template2,Template1,FF_UFF_COLOR |FF_UFF_COMBINED_FONTS |FF_UFF_COND |FF_UFF_DOCUMENT_PROPS |FF_UFF_FONT |FF_UFF_MATH |FF_UFF_PAGE |FF_UFF_PGF |FF_UFF_TABLE |FF_UFF_VAR))
    4. Read the text frames from "Template1" and create new text frame in Template2
         pgfId = F_ApiGetId(FV_SessionId, Template1, FP_FirstFlowInDoc);
         while (pgfid) {
         //     create a new text frame in Template2
              tFrameId = F_ApiNewGraphicObject(Template2, FO_TextFrame, pFrameId);
              objGraphicId = F_ApiGetId(Template1, pgfId, FP_FirstTextFrameInFlow);
         //assigning the properties of text frames
              propspdf = F_ApiGetProps(docIdfrom, objGraphicId);
              F_ApiSetProps(docIdto, tFrameId,&propspdf);
    Till this step, it is working as expected.
    Next I need to read the paragraphs of each text frame and put only static text available in the TEXT FRAMES OF Template1 in newly crated TEXT FRAMES of Template2. But ignore the variables in the text frames.
    I tried to work with the following piece of code
         doc2PgfId = F_ApiGetId(docIdfrom, objGraphicId, FP_FirstPgf);
         doc1PgfId = F_ApiGetId(docIdto, tFrameId, FP_FirstPgf);
         while (doc2PgfId && doc1PgfId)
                   F_ApiDeallocatePropVals(&propspdf);
                   tispdf = F_ApiGetText(docIdfrom, doc2PgfId, FTI_String|FTI_PgfBegin|FTI_PgfEnd);
                   tisspdf = F_ApiGetText(docIdto, doc1PgfId, FTI_String);
                   n=tispdf.len;
                   n1=tisspdf.len;
                   for(i=0; i<tispdf.len;i++){
                         ti = &tispdf.val[i];
                         tiT = &tisspdf.val[i];
                         //compare the text type and handle each text item appropriately
                         switch(ti->dataType){
                         //handle normal free flowing text
                          case(FTI_String):
                           //F_ApiAlert("In String", FF_ALERT_CONTINUE_NOTE);
                           tr.beg.objId = pgfId;
                           tr.beg.offset = ti->offset;
                           trT.beg.objId = tr.beg.objId;
                           trT.beg.offset = tr.beg.offset;
                        F_ApiDeallocatePropVals(&props);
                        props = F_ApiGetTextProps(docIdfrom, &tr.beg);
                        F_ApiSetTextProps(docIdto, &trT.beg,&props);
                        name1=(StringT)ti->u.sdata;
                        textLoc=F_ApiAddText(docIdto, &trT.beg,name1);
            //textLoc.objId = pgfId1;
            //textLoc.offset = textLoc.offset;
            //if the text string is a part of a variable then
            //it would have been taken care of so ignore it
            break;
           case(FTI_PgfBegin):
                      pgfId = ti->u.idata;
                      pgfId1 = tiT->u.idata;
                      propspdf = F_ApiGetProps(docIdfrom, pgfId);
                      F_ApiSetProps(docIdto, pgfId1,&propspdf);
                       break;
           case(FTI_PgfEnd):
                 pgfId = 0;
                 pgfId1= 0;
                 textLoc.offset=0;
                 bPgfalive = False;
                 break;
         //Get ID of next pgf in frame
    where am I going wrong? Is there any simple way of doing it?
    How do I go ahead with this? Please help..!
    Thanks,
    Basav

    Hi Michael,
    Thanks for quick reply..!
    There was a piece of code which validates whether the text frame I needed exists or not. I intentionally removed so as to not to confuse the reader.
    Let me give you a clear picture that what I want to do..!
    I've a MIF file and XML file that has the details of text frames and its contents in the MIF. XML looks like
    <?xml version="1.0" encoding="UTF-8"?>
    <MyProjectXML>
    <TextFrame frame="fr18111dd"><P>Basava</P></TextFrame>
    <TextFrame frame="fr224362cc"><P>Prabhu</P></TextFrame>
    <TextFrame frame="fr2547"><P>5 Year Performance (US Dollar)</P></TextFrame>
    </MyProjectXML>
    My MIF file has more than 50  named text frames. Some of them are in XML file, like - fr18111dd, fr224362cc,fr2547. These text frames have the static text,variables and tables. [ Tables I've kept it aside to work later for now]
    What I need -
    Need a MIF file that has frames available in XML file and replace the variables with the values given in <P> tag and keep the static text as it is.
    I'm trying the other way now, Open the MIF file and delete all the text frames except the frames mentioned in the XML file and save as new file.
    Let me know if I'm doing anything wrong here..! That will save my time and effort.
    Am I clear on my query? and what I wanted to achive ? Let me know otherwise..!
    Thanks,
    Basav

  • Copy texts from parent line item to substituted line item in Sales order

    Hi Guys,
    I want to copy texts from parent line item to substituted line item in a sales order where the material is substituted by SCM.Can you guide me which FM can be used in which user exit or any new suggestion?
    Thanks
    Swathi

    Hi,
    do you want to set long text or just short one? Obviously you can not use this BADI to set different fields than are available in the method interface. But I found thread with a similar problem here on SDN.
    Re: Automatic Population of Texts during Sales Order Processing
    If you call subroutine on commit, it should be working.

  • Want to copy Delivery address of one line item in shopping cart to all item

    Hi Experts,
                    We are upgrading from SRM 5.0 to SRM 7.0,In SC Creation We want to copy Delivery address of one line item in shopping cart to all line items in Shopping cart by clicking Change All Items button.This is custom button we added this button and we had written code to achieve the functionality but it is not working.This is same like Change All Items button in Account Assigment for copy accont details of one line item to all other line items in SC.
    Web Dynpro Component:/SAPSRM/WDC_UI_DO_SHIPTO
    Web Dynpro View:V_DODC_SHIPTO
    Thanks,
    Aarthi.

    Hi Prasad,
                   Our customer needs that button,they want whenever they are clicking the button delivery address should copy to all line items.
    In my action ONCHANGE_ALL_ITEMS i called this method
    wd_this->mo_dodm_shipto->zchange_all_items( ).
    zchange_all_items( ) is  implemented in class /SAPSRM/CL_CH_WD_DODM_SHIPTO.
    the code i wrote inside zchange_all_items( )
    *Error
      DATA: LX_PDO_ABORT               TYPE REF TO /SAPSRM/CX_PDO_ABORT,  " Class for Fatal error caught by PDO Layer
            LX_PDO_ERROR               TYPE REF TO /SAPSRM/CX_PDO_ERROR.  " Class for PDO General Exception
    Object Instances
      DATA: LO_MSG_CONSUMER            TYPE REF TO /SAPSRM/IF_PDO_MSG_CONSUMER,
            LO_PDO_SHIPTO              TYPE REF TO /SAPSRM/IF_PDO_DO_PARTNER.
    Context-Data
      DATA: lte_cll_shipto              TYPE /sapsrm/if_ch_wd_set_facade=>gt_guid_element,
            loe_cll_shipto              TYPE REF TO /sapsrm/if_ch_wd_set_element.
    Field Symbols
      FIELD-SYMBOLS <lse_cll_shipto>    LIKE LINE OF lte_cll_shipto.
    DATA : lo_pdo_acc TYPE REF TO /sapsrm/if_pdo_do_acct_assgmnt.
      DATA : ls_shipto_cll type /SAPSRM/S_CLL_SHIPTO,
             lt_pdo_partnerdetails      TYPE bbp_pdt_partner,
             ls_pdo_partnerdetails      TYPE bbp_pds_partner,
              LV_GUID          TYPE BBP_GUID,
              lv_item_guid type bbp_guid,
             lv_filled TYPE wdy_boolean.
    *exceptions
      DATA : LX_ABORT                  TYPE REF TO /SAPSRM/CX_PDO_ABORT.
    *Constants
      CONSTANTS : LC_OBJECT_ID         TYPE CRMT_SUBOBJECT_CATEGORY_DB VALUE 'BUS2121001',
                  LC_ADDR_ORIGIN       TYPE /SAPSRM/S_CLL_SHIPTO-ADDR_ORIGIN VALUE 'B'.
      IF LV_FILLED = ABAP_TRUE.
    Downcasting to shipto
        LO_PDO_SHIPTO ?= MO_PDO.
    insert the clipboard into facade and update and submit update
        me->/sapsrm/if_cll_do_mapper~insert_from_clipboard( io_set_facade = mon_cll_set_facade ).
    Add new Accounting entries.
        lte_cll_shipto = mon_cll_set_facade->get_data_elements( ). "get all elements from the context
        LOOP AT  lte_cll_shipto ASSIGNING <lse_cll_shipto>.
          loe_cll_shipto = <lse_cll_shipto>-set_element.
          loe_cll_shipto->get_static_attributes( IMPORTING rv_attributes = ls_shipto_cll ).
    Map ui-structure to pdo-structure
          MOVE-CORRESPONDING ls_shipto_cll TO ls_pdo_partnerdetails.
          IF LS_SHIPTO_CLL-PARTNER_FCT =  mv_part_func.
            LS_PDO_PARTNERDETAILS-PARTNER_FCT = ''.
          ELSE.
            LS_PDO_PARTNERDETAILS-PARTNER_FCT = LS_SHIPTO_CLL-PARTNER_FCT.
          ENDIF.
          IF ls_pdo_partnerdetails-del_ind NE 'X'.
            CALL FUNCTION 'GUID_CREATE'
              IMPORTING
                ev_guid_16 = ls_pdo_partnerdetails-p_guid.
           mv_acc_guid_split = ls_pdo_shipto-guid .
            IF mo_scope = 1.
              ls_pdo_partnerdetails-p_guid = mon_cll_set_facade->get_bo_guid( ).
            ELSE.
              ls_pdo_partnerdetails-p_guid = mo_parent_bo_mapper->items_get_lead_selection( ).
            ENDIF.
            APPEND ls_pdo_partnerdetails TO lt_pdo_partnerdetails.
          ENDIF.
          CLEAR : ls_pdo_partnerdetails, ls_shipto_cll.
        ENDLOOP.
    Add New items to PDO
        IF NOT lt_pdo_partnerdetails[] IS INITIAL.
          TRY.
              LO_PDO_SHIPTO->update_item_partners( EXPORTING it_partner = lt_pdo_partnerdetails
                                                               iv_item_guid       = lv_item_guid
                                                   CHANGING co_message_handler = mo_pdo_message_consumer ).
            CATCH /sapsrm/cx_pdo_abort INTO lx_pdo_abort.
              mo_cll_message_handler->set_abort( io_pdo_abort_exception = lx_pdo_abort ).
            CATCH /sapsrm/cx_pdo_error INTO lx_pdo_error.
              mo_cll_message_handler->add_exception( io_pdo_error_exception = lx_pdo_error ).
          ENDTRY.
    Update PDO with the changed data.
          TRY.
              mo_pdo->submit_update( ).
            CATCH /sapsrm/cx_pdo_abort INTO lx_pdo_abort.
              mo_cll_message_handler->set_abort( io_pdo_abort_exception = lx_pdo_abort ).
            CATCH /sapsrm/cx_pdo_error INTO lx_pdo_error.
              mo_cll_message_handler->add_exception( io_pdo_error_exception = lx_pdo_error ).
          ENDTRY.
    Fire refresh of DO Mappers registered for refresh since the item table has acc related data.
          mo_parent_bo_mapper->fire_event_refresh( iv_perform_updates = abap_false ).
        ENDIF.
      ENDIF.
    Thanks,
    Aarthi.

  • How I forward text from one iphone 4 to other, only forward the calls

    how I forward text from one iphone 4 to other, only forward the calls

    you can't forward incoming texts to another phone automatically.

  • Copy PO line item text to Migo line item text during PGR posting

    Dear all,
    I need to automatically copy over the ekpo-sgtxt over to screen field goitem-sgtxt during MIGO creation. Meaning, in MIGO - I enter the reference PO number and by the time I press enter, the system will propose the line items along with the "Text"field maintained with the data copied over from ME23N line items.
    Is there a user exit for this? If this question has been asked before, I'd be grateful if anyone can point me to that link.
    Thanks in advance.
    Steven

    Hello,
    How about trying userexit EXIT_SAPMM07M_001.
    Regards
    Waza

  • Copy line item text in all line items

    Hi
    My requirement is during transaction, if long text entered in one line item the same taxt should copy to all line item by default. if user want to chane the same for particular line item, it should be changable.
    Is it possible?. If yes, please revert in detail.
    Regards

    Hi Devi,
    If you put a plus sign in the text field, the system copy the previuos line text into the current field.
    Of course you can change it if you want.
    In addition we did a change in our system so the header text is transfered to the lines text when the line text field is empty.
    Regards
    Ofer

  • MAXDB copy log file from one server to the other server.

    Hi All,
    I want to copy a log file from one server to the other server , the database is Maxdb and i don't know how to do it. I want to do it through command prompt, (set of commands required) the front end tool which we are using is DBM ( database manager). Please help.
    Regards
    M.A

    Hi,
    Basically, the process is of log shipping. Transferring logs from DC to DR system.
    For that, you can check HowTo - Standby DB log shipping - MaxDB - SCN Wiki
    This is script based. I have not done it but the idea remains the same.
    Regards,
    Divyanshu

  • Need help to change line item text for 220 Line items

    Hi Specialists,
    The user has posted a reversal entry ( doc type : Manual Accrual) using TCODE FBS1.
    It has 220 line items.
    Is there a way in SAP he can change the text of All Line Items for a particular document number in one shot ( Mass Change).
    Pls note : Header text remains same . Only the line item text needs to be changed in one shot .
    For Eg :
      1 50 2758000047 Accruals for CAS               Accrl - Dec 08 / Nalini Marketing(Door Mats) - Oth
      2 50 2758000047 Accruals for CAS               Accrl - Dec 08 / SKC - M&E Repair
    Changed Description:
      1 50 2758000047 Accruals for CAS               Accrl - Jan 09 / Nalini Marketing(Door Mats) - Oth
      2 50 2758000047 Accruals for CAS               Accrl - Jan 09 / SKC - M&E Repair
    Thanks,
    Abhinav.

    Hi
    This is possible, please follow as below:
    If it is GL (FBL3N), Customer (FBL5N), Vendor (FBL1N) line item use the TCODE' mentioned.
    In the selection screen, if possible give all the document numbers (it is possible with addition selection).
    Once you get the output with the line item, select all line items and go to the menu options  there you can see the mass change option, it will give one popup screen give the new value in the text field and proceed further.
    VVR

  • Incoterms in sales order: part 2 is not taken from header to item level

    Dears,
    I got a customer with incoterm DDP in part 1 and a city "Hamburg" in part 2.
    When I create a sales order, I change part 2 from "Hamburg" into "Berlin" before I insert items.
    Unfortunately the changed content ("Berlin") is not taken to item level, there is still standing "Hamburg".
    I haven't found any solution for that behaviour.
    I hope, any one can answer how to solve that.
    Many thanks.
    Chris

    Thanks for reply.
    The flag is already checked, so there must be another reason.
    But, in the meantime, I found out, that there is a difference between some users.
    Some users can change the incoterm at item level, some others cannot.
    What could be the reason? Some profile settings?

  • Sales order fright  amount show due list in vendor line item

    hi all
    this is unique requirement from my client sales order fright condition accrued amount should directly post to vendor  item due list fbl1n from there he can settle the fright amount once the billing document is completed and fright condition amount should  show due in vendor line item my client delivery goods through fright vendor
    Let me know the configuration required
    thanks
    rajesh

    Dear Rajesh,
    Try to map this scenario through shipment process if your system is configure with.
    Process flow is
    Sales order> Delivery-> shipment document-> shipment cost->
    Purchase requistion on vendor for Frieght-PO>Invoice verification
    --> Sales billing against DO
    Hope this flow should match the requirement.
    Regards
    Rama Krishna

  • B2CBasket- Sales Order  How to add Vendor partner and new line item of SO

    Hi,
    I want to add the following BEFORE the sales order creation process starts:
    Add a VENDOR partner
    Add a new line item to ORDERADM_I
    I suspect in BADI CRM_ISA_BASKET_ITEMS and CRM_ISA_BASKET_HEAD. I have user 'HEAD' to add extension fields but cant figure the creation of NEW partners and NEW line item.
    regards,
    Dave

    Thank you for feedback Shantoor,
    The CRM_ORDER_MAINTAIN need not be called as this FM is called immediately following almost all of the CRM_ISA_* BADI's.
    For clarification I just want to expand on the solution..
    In all of these BADI's SAP uses the CT_INPUT_FIELDS parameter. This is where you should enter WHICH fields you have made changes to in the exit. CRM_ORDER_MAINTAIN uses the same parameter.
    However the challenge is .. WHAT do you enter in the CT_INPUT_FIELDS. This is where you have to follow a strategy. I yused the following:
    1. Looked where the structure was used in programs/class to see how SAP used it
    2. Set breakpoints at the call of the BADI. Check what CT_INPUT_FIELDS content is (SAP uses same technique)and try and replicate for your new entries.
    I hope this helps those that, like me, battled a bit with the use of these BADI's.

  • How can I copy/paste text from one page to another?

    I feel like I am taking crazy pills... is there really no way to copy a text box (or group) from one page to another while creating books in Aperture 3?  Lets say I have my entire book laid out and I want to add one paragraph at the end on one page which will push text and photos down a half page or so... in most programs for the last decade or so they added really cool functionality... cut/paste...  It seems like the apple developers are aware of it because they are in the context menus but they don't work on text, only photo boxes.  Additionally, you can copy/paste text but it erases all formatting.
    Seriously, am I missing something?  I have trouble believing that they can't include this function.
    Anyone else have this issue?

    Update... it seems to only happen with text boxes which I create.  So when I try an existing theme I can cut/copy/paste just fine, but in that same theme if you edit the layout and add a new text box, I can't copy paste it anywhere... the options are in the menu but nothing happens.
    Thoughts? Solutions?
    I am running 3.4.3 on a MacBook Pro OS X 10.8.3

  • Create multiple line item from one line item in BizTalk mapping

    Hi,
    In one of our new requirement we need to create 3 line items for every line item we are receiving with same value but in the below format.
    Sample Input:
    <EmpId>1234</EmpId><Name>ABCD></Name><Dept>YYY</Dept><Year>2014</Year><Desc1>D1</Desc1><Desc2>D2</Desc2><Desc3>D3</Desc3><Valid>Yes</Valid>
    Sample Output in Flatfile:
    1234,ABCD,,,D1,Yes
    1234,ABCD,YYY,,D2,Yes
    1234,ABCD,YYY,2014,D3,Yes
    Can you Pls help me in creating the mapping in above format.
    Thanks in advance,
    Regards,
    Elango
    Chennai.
    Mark As Answer or Vote As Helpful if My Reply Does.

    Elango,
    Before I explain about the solution, make sure when you give inputs/requirement in forums for us to help you, pay attention.
    The input instance you have shown
    Doesn’t have a root element
    Has a typo - <Name>ABCD></Name> -Element has invalid “>” character.
    This makes us to spend more time in cleansing your input and then find out solution.
    We are here to help you, so help us to help you better.
    Anyway, coming to the solution
    You have to create map with a structure similar to the below shown image:
    Here destination schema is a flat file schema with comma-delimited fields.
    If you look into the destination schema, it look similar to your input schema, but there is just one “Desc” field instead of “Desc1”, “Desc2”, “Desc3” in your source schema. In destination, the
    record has to repeat with same values for rest of the fields. And for “Desc” in destination schema will have corresponding index value of “Desc1” or “Desc2” or “Desc3” from source. i.e. first node of destination will have value of “Desc1” from source to “Desc”
    field in destination, second node of destination will have value of “Desc2” from source to “Desc” field in destination and third node of destination will have value of “Desc3” from source to “Desc” field in destination.
    I use XSLT in the map, with recursive template which will repeat for 3 times. I have given comment in the XSLT for your benefit.
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/Root" />
    </xsl:template>
    <xsl:template match="/Root">
    <Record>
    <!--Call the template with index and counter of 3. There times as you wanted for every item-->
    <xsl:call-template name="LintItemTemp">
    <xsl:with-param name="i">1</xsl:with-param>
    <xsl:with-param name="count">3</xsl:with-param>
    </xsl:call-template>
    </Record>
    </xsl:template>
    <xsl:template name="LintItemTemp">
    <xsl:param name="i" />
    <xsl:param name="count" />
    <Details>
    <EmpId>
    <xsl:value-of select="EmpId/text()" />
    </EmpId>
    <Name>
    <xsl:value-of select="Name/text()" />
    </Name>
    <Dept>
    <xsl:value-of select="Dept/text()" />
    </Dept>
    <Year>
    <xsl:value-of select="Year/text()" />
    </Year>
    <!--as in your output instance, Lineitem1 will have value of Desc1-->
    <xsl:if test ="($i =1)">
    <Desc>
    <xsl:value-of select="Desc1/text()" />
    </Desc>
    </xsl:if>
    <!--as in your output instance, Lineitem2 will have value of Desc3-->
    <xsl:if test ="($i =2)">
    <Desc>
    <xsl:value-of select="Desc2/text()" />
    </Desc>
    </xsl:if>
    <!--as in your output instance, Lineitem3 will have value of Desc3-->
    <xsl:if test ="($i =3)">
    <Desc>
    <xsl:value-of select="Desc3/text()" />
    </Desc>
    </xsl:if>
    <Valid>
    <xsl:value-of select="Valid/text()" />
    </Valid>
    <xsl:value-of select="./text()" />
    </Details>
    <!--Recursive template, i.e. calling the template again for 3 times as your requirement-->
    <xsl:if test="$i &lt; $count">
    <xsl:call-template name="LintItemTemp">
    <xsl:with-param name="i">
    <xsl:value-of select="$i + 1"/>
    </xsl:with-param>
    <xsl:with-param name="count">
    <xsl:value-of select="$count"/>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:if>
    </xsl:template>
    </xsl:stylesheet>
    So the input and output will look like the below:
    You can change the schema/XSLT and its corresponding namespaces as you want.
    When the above shown output is send to a custom-pipeline with flat file assembler in send port will output the above shown output to the flat-file structure as you wanted. Again, I repeat you
    to use flat-file file schema with comma-delimited fields as the destination schema in the above shown map for you to get the flat-file output as you needed.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How to copy a structure from one SAP system to other SAP system in ABAP

    Hi All,
      We have a requriement where need to copy an strcture of 250 feilds from on SAP system to other SAP system , do any one know how to do it .
    Regards
    Channu

    Channappa,
    It is really not hard to manually create the structure. Ctrl-Y copy from the source system screen and paste in the target system screen. You'll have to do this one page at a time. So, you will have to repeat it 9 times (or 18 times if you have to copy/paste component list and type separately).
    I can assure you that you can finish the task in less than 30 minutes.

Maybe you are looking for