Creating Infoset query based on ABAP program

Hello
I have 3 tables FEBEP, BKPF and BSEG and I need to join the 3 tables based on:
FEBEP-MANDT = BKPF-MANDT = BSEG-MANDT
FEBEP-NBBLN = BKPF-BELNR = BSEG-AUGBL
FEBEP-GJAHR = BKPF-GJAHR = BSEG-GJAHR
Then I have a few view fields from all the 3 tables. After this I can build an infoset query based on structure + ABAP program, and a generic datasource on top of it.
Can someone give me the ABAP code to be written SE38? Also should I select integrated program/external program in the infoset query?
Thanks,
Srini.

Hi,
Even if you create an ABAP program for infoset, you will writing a SELECT statement from BSEG table which is quite huge.
And you will putting JOIN with other tables.
Performance wise this is not advisble.
Why do not try the following other tables and check if the fields you need are available?
You can't join BSEG as it is a Cluster Table.In the place of BSEG you can use:
Account Recivables data use BSID and BSAD tables
GL Account Related data use BSIS and BSAS tables
Account payables data use BSIK and BSAK tables
Thanks.

Similar Messages

  • How to create Inbound Idocs in a ABAP program? Any function Module?

    Hello Experts,
    My requirement is : I have sales order data which I extracted from third party system in my internal tables. In the same box I need to create inbound Idocs and then consequently create sales orders.
    I have used the function module IDOC_INBOUND_WRITE_TO_DB to create inbound Idocs from Sales Orders data in internal tables. I have populated all the data records with correct PSGNUM and HLEVEL values. My plan is to create inbound idocs with this function module and send those to IDOC_INPUT_ORDERS function module which creates Sales Orders.
    If a sales order in the internal table in ABAP program contains only one item, then I am getting correct idocs. But if more than one item exists for a sales order then the line item segments which got repeated in Idoc are having PSGNUM and HLEVEL values as zero when I checked in WE02. As a result the hierarchy from the second item segment is getting disturbed and getting the status 60.
    I populated T_EDIDD with data records from  IDOC_INBOUND_WRITE_TO_DB.
    To the function module IDOC_INPUT_ORDERS,  T_EDIDC and T_EDIDD are the input. I observed that in T_EDIDD also the PSGNUM and HLEVEL values are blank.
    I am getting Status 60 with message 'EDI: Syntax error in IDoc (segment cannot be identified)' for idocs which have more than one item.
    I need to extract sales data from third party and create inbound idocs and create sales orders in one ABAP program only. I need to display corresponding Idoc numbers for the corresponding third party sales order number in a listoutput.
    Can anybody please provide inputs?
    Regards.

    Hi Anjali,
    Thanks for the response.
    I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
    for compatibility: clear administration data of data records
               perform data_records_wipe
                                      tables
                                          t_data_records.
    FORM DATA_RECORDS_WIPE
                      TABLES
                          T_DATA_RECORDS_IN  STRUCTURE EDIDD.
      LOOP AT  T_DATA_RECORDS_IN.
        CLEAR: T_DATA_RECORDS_IN-MANDT,
               T_DATA_RECORDS_IN-DOCNUM,
               T_DATA_RECORDS_IN-SEGNUM,
               T_DATA_RECORDS_IN-PSGNUM,
               T_DATA_RECORDS_IN-HLEVEL.
        modify t_data_records_in.
      ENDLOOP.
    ENDFORM.                               " DATA_RECORDS_WIPE
    This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
    I need to create INBOUND Idocs with the data in ABAP program.
    Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
    Regards

  • How to call a BW Query from an ABAP program?

    How to call a BW Query from an ABAP program?

    hi
    check this link
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
    /people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-ii
    /people/durairaj.athavanraja/blog/2005/12/05/execute-bw-query-using-abap-part-iii
    hope this helps
    cheers

  • Additional i/o fields to infoset query based on PNPCE logical database

    Hi All,
    I have a requirement to add two additional input and output fields "job function" and "job family" to a infoset query based on logical database PNPCE. I am new to writing code in infset query and there are so many code areas in infoset query. I am confused where to write code and how to limit the output list based on the user selection to the additional fields "Job function" and "job family". have any one done this in the past?. is there sample code somewhere to do something similar to this?
    Your help will be much appreciated with points! (as per our community guidelines)
    Regards,
    Arul

    Hello Arul,
    Your question would be better answered if you post it in on of the Business Intelligence Forums. Please close this thread and goto:
    Expert Forums » Business Intelligence
    or
    /community
    Regards,
    Manny

  • How to create Infosource with writing a ABAP program ?

    Hi,
    I want to create one program to create lot of infosources. Is there any Function module avilable for creating Infosource.
    It should be attachment of flat file, infosource and data source.
    Waiting for quick response.
    Best regards,
    BDP

    Hi Anjali,
    Thanks for the response.
    I have passed the PSGNUM and HLEVEL values while populating the data records. Then I sent the data records and control record information to the function module IDOC_INBOUND_WRITE_TO_DB. Inside this function module there is code to clear the PSGNUM values and HLEVEL values.
    for compatibility: clear administration data of data records
               perform data_records_wipe
                                      tables
                                          t_data_records.
    FORM DATA_RECORDS_WIPE
                      TABLES
                          T_DATA_RECORDS_IN  STRUCTURE EDIDD.
      LOOP AT  T_DATA_RECORDS_IN.
        CLEAR: T_DATA_RECORDS_IN-MANDT,
               T_DATA_RECORDS_IN-DOCNUM,
               T_DATA_RECORDS_IN-SEGNUM,
               T_DATA_RECORDS_IN-PSGNUM,
               T_DATA_RECORDS_IN-HLEVEL.
        modify t_data_records_in.
      ENDLOOP.
    ENDFORM.                               " DATA_RECORDS_WIPE
    This is the code which is clearing all the PSGNUM and HLEVEL values. After coming out of this function module we are getting the error idocs created with disturbed hierarchy.
    I need to create INBOUND Idocs with the data in ABAP program.
    Please let me know if any inputs? Is there any function module existing to create Inbound Idocs inside an ABAP program?
    Regards

  • Need to find SAP query for corresponding ABAP program.

    Hello SAP Experts,
    I have an ABAP program "AQDESYSTQV000001ORDERDETAILS==" in ECC 4.7. We had a client copy recently from ECC 4.7 to ECC 6.0. Now in ECC 6.0 I am unable to find this program in SE38.
    Can you please tell me how to create this program in ECC 6.0 ? Also, by the name of this program it is clearly seen that this program is automatically created by using SAP query.
    I tried to generate the program using SQ01, but system asks me for the SAP query.
    Can you please tell me how to find the SAP Query for the corresponding abap program ? Also, the steps as in how to generate the program in ECC 6.0.
    Thanks.

    Hi Danish,
    In the program name, the query name is always attached.
    For example : The program name is , AQ10SD==========Z10SD_INVPRODL=
                           Here the query name is Z10SD_INVPRODL and if you go to transaction SQ01 and enter the query name
    then you can find the infoset.
    And also you can gernate the program with the help of query name.
    Please try the same and let me know if any details are required.
    Regards,
    Darshana

  • SQ02 - Create InfoSet using 'Data retrieval by program'

    Using SQ02, I would like to use the data returned by an ABAP program as the data source for an InfoSet.  When attempting to create an InfoSet, I noticed the 'Data retrieval by program' option.  I would like to discover how to use this option and how to pass parameters to the ABAP program I'd like to use.

    The "Data retrieval program" would be coded like any normal report except for adding a few comment tags that will be used by SQ01 query generator as placeholders to insert its own code into your code to generate the query program.
    In general this is how a data retrieval program is coded. SQ01 when it generates the query will insert its own code in place of *<Query_body> and *<Query_head> comment tags
    REPORT ztest_sq01_driver_program.
    TABLES: <name of dictionary structure of your infoset>.
    * DATA declarations
    START-OF-SELECTION.
    *<Query_head>
    * <Fetch your data here and store it in an internal table gt_report> that has all the fields that you need in your query
    END-OF-SELECTION.
      LOOP AT gt_report INTO gs_report.
        MOVE-CORRESPONDING gs_report TO <name of dictionary structure of your infoset>
    *<Query_body>
      ENDLOOP.

  • How to create infoset query

    Hi,experts
    Can anybody give me documents on infoset query and step by step showing how to create infosetquery. I will really greatful to you all.
    Thanks
    Preeti

    Hi Preeti,
    1. You can query the data using 'Listcube' transaction.
    2. Instead of builing on tables, it sits on ODS (no need to worry about underlying tables).
    3. Visible on the Bex 'info area' as like other infoproviders.
    4. It generates additional key figure called 'Number of records' in the Bex. This will be useful for query.
    5. No additional ABAP can be used. But in RSQ02, you can use piece of ABAP.
    6. Queries created on data provider infoset can work like other queries including transport functionality.
    Hope helps.
    For more info check Re: Query on Infoset
    Bye
    Dinesh

  • How to create the condition record by ABAP program

    Hi Friends,
    I want to create/change the condition record of PR00 by ABAP program. It seems that there have no such BAPI/standard function can help on this. Can any one of you point out a way to me?? Thanks in addvance.
    Joe GR.

    Joe,
      Check with below FM..
    BAPI_PRICES_CONDITIONS.
    Check this link:
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    examples....
    http://www.4ap.de/abap/bapi_prices_conditions.php
    Two useful threads on Same topic
    Re: Sample code for  BAPI_PRICES_CONDITIONS
    Re: Problem with BAPI_PRICES_CONDITIONS
    BAPI_PRICES_CONDITIONS
    Please check this sample code from other thread.
    wtable1-table_no = '306'.
    wtable1-applicatio = 'V'.
    wtable1-cond_type = 'ZPR0'.
    wtable1-operation = '009'.
    wtable1-varkey = '13001001USD 000000000050068946'.
    wtable1-valid_to = '99991231'.
    wtable1-valid_from = '20051101'.
    wtable1-cond_no = '$000000001'.
    APPEND wtable1 TO table1.
    wtable2-operation = '009'.
    wtable2-cond_no = '$000000001'.
    wtable2-created_by = sy-uname.
    wtable2-creat_date = '20051022'.
    wtable2-cond_usage = 'A'.
    wtable2-table_no = '110'.
    wtable2-applicatio = 'V'.
    wtable2-cond_type = 'ZPR0'.
    wtable2-varkey = '13001001USD 000000000050068946'.
    wtable2-valid_from = '20051101'.
    wtable2-valid_to = '99991231'.
    APPEND wtable2 TO table2.
    wtable3-operation = '009'.
    wtable3-cond_no = '$000000001'.
    wtable3-cond_count = '01'.
    wtable3-applicatio = 'V'.
    wtable3-cond_type = 'ZPR0'.
    wtable3-scaletype = 'A'.
    wtable3-scalebasin = 'C'.
    wtable3-scale_qty = '1'.
    wtable3-cond_p_unt = '1'.
    wtable3-cond_unit = 'EA'.
    wtable3-calctypcon = 'C'.
    wtable3-cond_value = '454'.
    wtable3-condcurr = 'USD'.
    APPEND wtable3 TO table3.
    CALL FUNCTION 'BAPI_PRICES_CONDITIONS'
    EXPORTING
    PI_initialmode = 'X'
    PI_BLOCKNUMBER =
    TABLES
    ti_bapicondct = table1
    ti_bapicondhd = table2
    ti_bapicondit = table3
    ti_bapicondqs = table4
    ti_bapicondvs = table5
    to_bapiret2 = table6
    to_bapiknumhs = table7
    to_mem_initial = table8
    EXCEPTIONS
    update_error = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    READ TABLE table6 WITH KEY type = 'E' TRANSPORTING NO FIELDS.
    IF sy-subrc = 0.
    loop at table6 into ret.
    write: / ret-type, ret-message, ret-id, RET-LOG_NO, RET-LOG_MSG_NO,
    RET-MESSAGE_V1, RET-MESSAGE_V2, RET-MESSAGE_V3, RET-MESSAGE_V4,
    RET-PARAMETER,RET-ROW,RET-FIELD.
    endloop.
    ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    *EXPORTING
    WAIT =
    IMPORTING
    return = ret
    ENDIF.
    Don't forget to reward if useful....

  • BW Datasource on an Infoset Query based on 2 DSO Active tables

    Hello,
    We have created a Datasource in the BW system over an Infoset query (through SQ02) built on 2 DSO tables.
    In RSA3, this datasource is working fine - it shows us some data (close to 1000 records).
    The issue is when i try and run a infopackage for the datasource.
    The request times out and no records are fetched.
    I have added all the users to the Infoset user group - so, no issue with the authorization.
    IDoc Statuses changes from 53 --> 62 --> 64 --> 50.
    The extraction process does not complete - does not get the no. of records sent.
    Can anybody point to a probable cause here?
    Thank you.

    IDoc logs do not say much.
    Status Record 53: IDoc was successfully transferred
    Status Record 62: IDoc passed to application; Direct call started
    Status Record 64: IDoc ready to be transferred to application; No filter, no conversion
    Status Record 50: IDoc added
    Then, it does not go any further.
    We're using the Datasource on the Infoset query because we could not use the traditional BW infoset.
    Datsource is used to feed a DSO as we directly could not use anything else (we're trying with an expert routine also).
    The issue is that the base DSO tables are huge and querying on them (using SELECT) is taking a very long time.
    So, we thought of using an Infoset to create a view and then populatet he data.
    In an traditional infoset, we could not specify a condition with a range. So, the infoset query through SQ02.
    I have not tried using an APD, but that might be a good option.
    Only thing, we'll have to use a Direct DSO - which i am not sure will satisfy our requirement.
    Thank you.

  • Create a DDic sturcture via ABAP program

    Hello,
    is it possible to create a DDic structure via a ABAP program? I've got the components and component type of the new structure in a table.
    I want to create a DDic structure with this information. Is there function module or a method, with this functionality?
    Thanks for help!
    Matthias

    I need a DDic structure to use this in the exporting parameters of an remote-enabled function module.  Thier isn't it posible to use an none typed parameter, because of the remote.
    I want to create an admin-screen for an tool calls DocFinder. For this tool you need for every DocuSpace an extra structure to return the values.
    We use this tool in an shared systemlandscape so its nessessary to use an remode-enabled function module.
    In the admin-screen it should be able to create an new DocuSpace with its structures and other generatet coding.
    But I've got no idea how to create an structure via programm.

  • How to create crystal reports from ecc abap program?

    Hi all,
    I am new to sap ecc to bo report!!
    I heard that abap program cannot be directly connected to crystal reports,
    So created a function module which is equivalent to the abap program!!
    And happened to connect the same in crystal !!
    Can anyone let me know how to proceed !!
    will be there any performance issue ?
    can anyone guide me how to do reporting from ecc function module to crystal reports directly?
    Thanks

    Hi Pooja,
    From what I know, not all ABAP programs can be accessed in Crystal Reports. The program should return rows and columns, otherwise, CR would not be able to report off it.
    I'm not sure if there are any performance issues if we follow your path. Do you experience any?
    And, do you need help in creating a report on the function module, I mean do you also have any design related queries?
    -Abhilash

  • Infoset Query based on 0023 IT

    Hi,
    I have created one infoset query for infotype 0023. When I am executing this report for all the employees I can see the records. But if I select just one employee only blank fields are coming.
    Samriddhi

    Hi,
    That employee has four records on 0023 infotype.
    And I have checked with both Reporting periods All and Past(until today).
    But still one record is coming that too blank although employee has four records.
    1st record (01.06.2000 - 21.12.2002)
    2nd record (01.12.1996 - 01.06.2000)
    3rd record (01.04.1991 - 01.08.1996)
    4th record (01.061989 - 01.03.1991)
    Then I created one more record from the date 01.09.2008(start date in the present company) to
    31.12.9999.
    When I am executing the Adhoc Query I am getting only this last record. In selection I have choosen personnel number of that employee.
    But if in the selection field I didn't choose any personnel number it will show all the records of all employee.
    Samriddhi

  • SCCM2012: Can you create a Query-based "User Collection" using an IP Subnet (or IP Address range) in the Query?

    The topic says it all (I hope).  I am new to 2012 and I have tried to accomplish this feat all day, which includes researching online, but I have had zero success in finding anything helpful.
    Obviously I can create "Device Collections" based on the IP Subnets, and I can do a "Direct Rule" in "User Collections" for the desired IP Subnet, but I do not want to do this because I need the results to update if/when
    any changes occur during a "scheduled/incremental update".
    The only thing I could find for the "User Collections" was this:
    select *  from  SMS_R_User where SMS_R_User.FullUserName = SMS_R_User.UserName and SMS_R_System.IPAddresses like "111.11.1%"
    EXAMPLE (Query for Devices):
    select *  from  SMS_R_System where SMS_R_System.IPAddresses like "111.11.1%"
    Is there a way to Query SCCM (2012) and display the Usernames of computers that login to the (sole) Domain through a specified (or desired) IP Subnet?

    Why do you want to install software by location for a user? Why do you care?
    Why would you want to create a collected of Users with software installed? PCs have the SW install not users so how would you use it?
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ
    I was asked to setup these (Device and User Collections) in this manner so we can limit future distributions/deployments of Applications (and/or Packages) and (OS) Images by these groupings.  Apparently there will be occasions where deployments will need
    to be segmented as such because the company wants to have them grouped in this manner.  If there is a better option available than this, which I would not doubt since I am new to SCCM 2012, then I would appreciate the information.
    IMO, you need to go back to the person asking and get and better understand of exactly what they want and more importantly why.  Making a collection, just in case doesn't make sense.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • Create Node in Solar01 using ABAP Program

    Hi Experts
    In our project, the integration between ARIS and Solution Manager is not working. So the project team has decided to develop a workaround solution for this problem. The solution is we download all the BPP & BPS from ARIS into an excel file. We should upload the file and create the necessary BPP/BPS nodes in SOLAR01 using an ABAP program. Now we have the file and the below data in file.
    We have the parent level SAP GUID in the file. Using this as reference we need to create the below two nodes.
    ARIS Level 4 Sub-Process - This should be created as Solution Manager Business Process Node
    ARIS Level 5 Task - This should be created as Solution Manager Business Process Step Node
    Can anyone of you have done any similar development to the above? I will really appreciate if you can provide me with some function modules or any pseudo code or the approach to achieve this requirement.
    Regards
    Hari

    Hi Hari,
    There is no need of creating a program
    this functionality is available in Solution manager 7.1 to upload via content files like excel sheet etc
    https://help.sap.com/saphelp_sm71_sp05/helpdata/en/ea/7d9d444c404849bf99a0dd19f2107a/content.htm
    you can refer my below article for all the steps
    SAPexperts | How to Quickly Create Business Blueprints in SAP Solution Manager 7.1 Using Content Upload Interface
    Thanks
    Prakhar

Maybe you are looking for

  • Low quality of burned DVD even if I drag&drop iMovie project into iDVD

    Hi all, I've a iMovie HD project that I want to burn via iDVD (7.0.4). If I click "Share with iDVD" the quality of the resultung video (which is burned to DVD) is rather poor. As I've read within this discussions, the preferred way is to close iMovie

  • Dynamic variant at job - selection options

    Hi Experts, Could any of You pls help me to find out the original selection for a job, if the selection variant was not saved previously? There are a couple of user report, which could be run at the background with an ad-hoc selection variant, such a

  • FTP STOR command with REST capability

    Hi folk, I have a cRIO on a remote field, and I need that the program running on that platform periodically uploaded, through the internet, the data files to an FTP server. I have used the FTP VIs included in the Internet Toolkit to develop this func

  • Adjustment brush (retouch) slow to the point of being unsusable

    First, system and config info: Mac Pro (2 x 2.66Ghz) 6 GB RAM ATI Radeon 4870 w/512MB VRAM OS X 10.6.2 Aperture 3.0.1 Aperture library is on a separate disk from the referenced images. Neither the library nor the images are on the boot drive. My test

  • Steps to start the Early watch report

    Hi Experts, Can you explain me about early watch report in detail and let me know the step by step to prepare early watch report. Is there any difference between Early watch report and Early watch alert? Regards, Suresh.