Getting valid idoc number from the sales document

hi,
Iam sending the code for getting the idoc number from sales document.
but iam not getting the result.
please see the code and correct the code so that i will get the idoc number from the sales document.
tables edid4.
data l_docnum like edid4-docnum.
parameters:p_vbeln like vbak-vbeln.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
  exporting
    input         = p_vbeln
IMPORTING
   OUTPUT        = p_vbeln
select single docnum from edid4 into l_docnum where sdata like '&p_vbeln&'.
if sy-subrc = 0.
write edid4-docnum.
else.
write ' the record is not found'.
endif.
it is very urgent..............
thanks in advance......

See the below code :
report zxyz.
tables edid4.
data l_docnum like edid4-docnum.
parameters:p_vbeln like vbak-vbeln.
<b>data sdata like edid4-sdata.</b>
start-of-selection.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = p_vbeln
IMPORTING
OUTPUT = p_vbeln
<b>concatenate '%' p_vbeln '%' into sdata.</b>
select single docnum from edid4 into l_docnum
              where sdata like <b>sdata.</b>
if sy-subrc = 0.
write edid4-docnum.
else.
write ' the record is not found'.
endif.
Thanks
Seshu

Similar Messages

  • How to get MM Invoice number from FI Accounting document number

    Hi,
    I am writing a query (OPEN ITEMS FOR ACCOUNT PAYABLE)through SQVI. We need to display MM Invoice number from FI Accounting document number . Please let me know the table name from where I can join FI document number and can retreive MM Invoice number.
    Thanks
    Rama

    hi,
    use this.
      SELECT belnr
               awkey
               INTO TABLE it_bkpf
               FROM bkpf
               FOR ALL ENTRIES IN it_mkpf
               WHERE awkey = it_mkpf-awkey.

  • ADF BC - How to get validation picked up from the database.

    Is there a way the ADF BC can be created so it contains the check constraints from the database?
    I assume if it did, it would pre-fill the "validation" branch in the Entity Object Editor.

    Frank,
    Thank you very much for your reply. I've set "valuePassThrough" property of the dropdownlist to true. In the valueChangeListener, my code looks like this.
    public void TD_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    System.out.println("+++++++++");
    System.out.println("TD_valueChangeListener");
    Number n = null;
    BindingContainer bc = this.getBindings();
    if(bc != null){
    System.out.println("bc is not null");
    //get the selected TD
    FacesCtrlListBinding TdIter = (FacesCtrlListBinding)bc.get("LandLegalView1Td");
    if(TdIter != null){ 
    System.out.println("TdIter is not null");
    if(valueChangeEvent.getNewValue() != null)
    try{n = new Number(valueChangeEvent.getNewValue());}
    catch(Exception e){
    e.getMessage();
    System.out.println("selected TD index="+n);
    //Object td = TdIter.getAttributeFromRow(n.intValue(), "Td");
    Object td = TdIter.getAttribute(n.intValue());
    System.out.println("real value of td=" + td);
    }else{
    System.out.println("TD is null");
    }else{
    System.out.println("TdIter is null");
    My question here is: I tried two ways of getting the real value of the new selected value. One is "Object td = TdIter.getAttributeFromRow(n.intValue(), "Td");". The other is "Object td = TdIter.getAttribute(n.intValue());". None of them give me the new selected value but the old value. Did I do anything wrong?
    Regards,
    Annie

  • Get ECC idoc number from PI

    Hi All
    IS there a way to get the IDOC number created in the ecc system from PI? A FM or something you can call the get the ecc idoc number?

    IDoc acknowledgements is the way to go.
    Configure ALEAUD and it should respond back with the IDoc number and what happened to the IDoc in SAP
    http://help.sap.com/saphelp_nw04/helpdata/en/0b/2a6550507d11d18ee90000e8366fc2/frameset.htm

  • Obtaining Material number from the CRM Document number

    Hi Gurus
    From which table can I get the material number if I know the CRM document number. Which are the tables that need to be linked to get this information?
    thank you very much

    Hi,
    Using doc number you can access CRMD_ORDERADM_H-OBJECT_ID = DOCNUM.
    CRMD_ORDERADM_I-HEADER = CRMD_ORDERADM_H--GUID.
    The material is in CRMD_ORDERADM_I.
    Hope this helps.
    Best regards,
    Caíque Escaler

  • I am locked out of my phone because I forgot my password and iTunes won't let me connect and I can't get a serial number from the ohone because it's locked.

    I had forgotten my passcode on my phone and finally it said that my iPhone was disabled and that it needed to be connected to iTunes. Well for it to connect to iTunes it needed for me to respond on my iPhone but my iPhone is disabled! I'm so frustrated. And I can't get to the serial number because it's locked so I can't get ahold of Apple.

    http://support.apple.com/kb/ht1808

  • Get IDoc-number from flat IDoc using dynamic configuration

    Dear experts
    In an IDoc2File scenario I have added the IDoc-number to dynamic configuration using the folling code in an UDF:
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","DOCNUM");
    conf.put(FileName, a);
    The information is stored in the SOAP message
    <SAP:DynamicConfiguration SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="DOCNUM">0000000000012345</SAP:Record>
    </SAP:DynamicConfiguration>
    Can anybody tell me how I can access this information in the "variable substitution" section of the CC? Perhaps something like "message:docnum"?
    Additional information:
    Taking the IDoc-number from the payload using e.g. "payload:ORDERS05,1,IDOC,1,EDI_DC40,1,DOCNUM,1" does not work, since the XML-IDoc has been converted to an flat-IDoc.
    Thanks in advance for any good ideas
    Markus

    Dear Rodrigo and Sarvesh
    Thanks for your help so far! I applied your hints and now it is working fine.
    But now I have the following additional questions
    1.) My message mapping only maps the input IDoc to an output IDoc of the same type and structure. The MM is only required to process the UDF. Is there another, better solution to achieve my requirement that the IDoc-number shall be part of the filename?
    2.) In the CC you have the possibility to use temporary files (section "Processing", Option "Put File" = "Use Temporary File". I think this will not work with the given solution, will it?
    To possibly help somebody else or clarify the mechanism once again, I wrote down how my solution now looks like.
    My UDF in the message-mapping looks like this
    - Input = DOCNUM of IDoc, e.g. ORDERS05/IDOC/EDIDC/DOCNUM
    - Outpt = DOCNUM of IDoc, e.g. ORDERS05/IDOC/EDIDC/DOCNUM
    - UDF:
    public String putDynamicConfiguration(String docnum, Container container) throws StreamTransformationException{
    try
         DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
         DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
         String filename = "Prefix_" + docnum + ".txt";
         conf.put(key, filename);
         return docnum;
    catch (Exception e)
         return docnum;
    In the CC the settings are now as follows
    File Name Scheme = . -> only a dot or something else, because this field is obligatory, even if it is not used in this case.
    Variable substitution (...)
        Enable -> unchecked
    Adapter-Specific Message Attributes
        Use Adapter-Specific Message Attributes -> checked
        Fail If Adapter-Specific Message Attributes Missing -> checked
        File Name -> checked
        Directory, File Type, Temporary Name Scheme for Target File Name -> unchecked
    When I send an IDoc to PI and view the Adapte-Engine Version of the message (the SOAP-document, not the payload) I can find the Filename:
    <SAP:DynamicConfiguration SOAP:mustUnderstand="1">
    <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">Prefix_0000000000012345.txt</SAP:Record>
    </SAP:DynamicConfiguration>

  • Problem in finding Idoc number from Delivery document number(VERY URGENT)

    Hi experts,
    I have a delivery document number.Now i have to find the Idoc number for thet delivery document and extract some necessary data from one of the segment of that Idoc.So I am not able to find a link through tables .
    So I exact query is 'what is the selection method i have to follow to get the idoc number given the delivery document number'.
    Regards,
    Praveen.
    Edited by: Praveen Jada on Mar 14, 2008 12:15 PM

    That's what I meant, do the following query:
    DATA: LT_DOCNUM TYPE TABLE OF EDI_DOCNUM.
    SELECT DOCNUM
      INTO TABLE LT_DOCNUM
      FROM EDID4
      WHERE SEGNAM EQ 'E1EDL20'
      AND SDATA EQ '0001234567%'.
    This will list you all the IDOC numbers in which delivery number 0001234567 appear in the delivery header segment.
    Depending on your process it's probably going to be one entry only.
    Hope that clarifies it,
    Michael

  • How to populate the sales document number in FD10N or FBL5N report

    Hi Gurus,
    In the reports FBL5N and FD10N i am able to see the Billing document field(VBELN) populated with the number but The sales document number (AUBEL) is not populated with the number.
    How to get this number updated to the FBL5N or FD10N report.
    Thanks in advance.

    Hai
    Goto Settings Special Fields and add the required fields and save and come back and exceute again.
    Regards
    Raghavendra.M
    SAP-Practice

  • Idoc number from sales order in ECC

    Hi,
    Sales order is created by processing an Idoc. Now i want to trace back the idoc number for the sales order created.
    Please let me how we can do this in ECC. I saw couple of posts stating ICON SERVICE FOR OBJECTS...i couldn't really identify that icon. In someother post i saw this can found under Environment.
    Please let me know whether there are any prerequisites for this, and how i can i achieve this in ECC?
    Thank You in Advacne
    Thank You
    Challa

    Hi Challa,
    To find which idoc created the sales order, you can do the following,
    Check for the customer PO no in the sales order.
    Then go to any other inbound idoc which is bound to create a sales order, and see in which segment is the PO number.
    Then go to WE09 and put the dates etc and then go to " Criteria for search in Data Records"
    Put the segement no in Search in segement field.
    Put the idoc field in which you see the PO number
    and put the PO no in the " for Value" field and execute.
    You will get the idoc which created the sales order.
    Let us know.
    Regards,
    SB

  • How to find Outbound Idoc number from inbound Idoc number.

    Hi,
    I have one inbound Idoc in my system, then
    How to find the  idoc number from the system which sends that idoc(Outbound Idoc number).

    Hello
    You can use fm SREL_GET_NEXT_NEIGHBORS for this purpose.
    Scenario: An EDI purchase order is received by SAP-XI and forwarded as Inbound ORDERS IDoc to R/3. SAP-XI generates an (outbound) IDoc number which differs from the (inbound) ORDERS05 IDoc in the R/3 system.
    Calling fm SREL_GET_NEXT_NEIGHBORS with the following parameters:
    OBJECT-OBJKEY = <IDoc number, 16-digits>
    OBJECT-OBJTYPE = 'IDOC'
    MAX_HOPS = '99'            " <<< get all links
    I get the following result:
    0000000000133906                                   IDOC       CUSTOMER   OUTIDOC
    0000000000407402                                   IDOC                  INIDOC
    000000370383                                       BUS2012    CUSTOMER   OUTBELEG
    0010057944                                         BUS2032               INBELEG
    Outbound IDoc number
    Inbound IDoc number (ORDERS05)
    PO number
    Sales order (created from inbound ORDERS IDoc)
    Regards
      Uwe

  • How to get customer number and name from the SD document

    Hi All,
    Can you please let me know how to get Customer Number and Name from the SD Document?
    Thanks a lot....
    Anil

    Hi,
    It will be displayed in the SD (BIlling document) itself,  you clikc on the VF03. The customer name and number will also appear in the SO document also Tcode VA03
    regards,
    radhika
    Edited by: kolipara radhika on Jul 10, 2009 5:32 AM

  • How do I get the line number of the sales order and how do I save info?

    I am trying to create a form that is able to be called from a right click on the sales order matrix and will display some of the user defined fields associated with the line.
    I've managed to create a form and add a menu option to the right click but I'm now stuck because of the following:
    1. How to I know which line the user selected? I need the REAL Line Number from the RDR1 table because I need to use it on the data filter of the form.
    2. I hard coded a line to just to see if I can load a form and it appears to load and bind the data to the controls, but how do I save changes made? There are several text fields, combo boxes, and a picture control.

    Hi Coleman,
    1. The pVal returned form a menu event does no provide the LineId, but a pVal from a Item Event does. I suggest you use a DoubleClick or Control + Click on the Line to trigger an event that you can catch and use to launch your form.
    2. Please note that if the Sales Order line is closed you'll not be able to update the values. If it's not, then you need to instantiate a Sales Order document, get the correct document with the GetByKey method and update whatever fields you need.
                    Dim oSalesOrder As SAPbobsCOM.Documents = oCompany.GetBusinessObject(BoObjectTypes.oOrders)
                    If oSalesOrder.GetByKey(docentry) = True Then
                        oSalesOrder.Lines.SetCurrentLine(pVal.Row - 1)
                        oSalesOrder.Lines.UserFields.Fields.Item("U_MyUDF").Value = ""
                        oSalesOrder.Update()
                    End If
    Regards,
    Vítor Vieira

  • How to get the delivery number for the sales order

    hi
    how to get the delivery number for the sales order

    Hi,
    1. IN VA03, enter the sales order and click on the document flow button. From there you can check the delivery document.
    2. In SE11, enter VBFA(Document flow) table and enter the sales order in VBELV field and in VBTYP_N field enter 'J' to specify that you want to check if there is already a delivery document for that sales order.
    Hope it helps...
    P.S. Please award points if it helps...

  • In FBL5N report user wants the sales document number to be displayed,

    HI, Guys
    Need ur help to sort out the problem
    In FBL5N report user wants the sales document number to be displayed,
    but the sales ducument number column is coming blank and this needs to pick from VBRP table
    As I discussed with Abaper, he reqiures a key field which common in BSEG abd VBRP table
    So,Please guide me in approaching the right way
    Munender

    Hi,
        Speak with your SD consultant. They can set up the copy control in SD so that the sales order is populated in the invoice in field ZUONR (Assignment).This will then copy to the assignment field in accounting.
    Alternatively you can use an exit to populate another field during the Posting.
    Kind regards

Maybe you are looking for

  • Creating a backup before Leopard install

    Is it possible to back up my entire 80gb imac startup drive to one of my firewire drives with assurance that I can go back to that system if my Leopard install goes haywire? My first attempt to install Leopard failed with some un-useful error message

  • Reason for rejection for sale order stock existing line item

    Hi,     I am giving reason for rejection for a line item where there is already sale order stock. Then I am getting a warning message like " there is sale order stock assigned". I want this message to be as error message. Any customisation (SPRO) is

  • Podcasts disappear from Ipod Classic

    I recntly purchased the ipod classic 120gb, and dowloaded a number of podcasts which I have been playing. However, yesterday I was viewing one (podcast) when the ipod froze for about 15 seconds, when I was able to go back into the menu all the podcas

  • Stroke effects not exporting to PDF from CS3

    Hi, I'm using CS3 on Windows XP. My problem is that some stroke effects are not showing up in PDFs. On a two page document, the effects on page one do not show up on the PDF but the effects on page two show up perfect. I've tried multiple export pres

  • My computer can't remember my password

    The sites don't ask me to remember my password. Can anyone help me?