SAP Query into FTP through ABAP

Hi Experts,
I have an SAP query which needs to be run on a daily basis (through a back ground job) and the data that is pulled has to be stored in a file in tab delimited format and the same should be extracted to an FTP site. Can you please suggest ways for this?
Thanks,
Shashank.

Hi ,
Thanks for our reply.
I have pasted some example code into my additional field which I have created in SAP Query But im not sure how the loop bit works and how I can populate the additional fields that I have created , could you please explain this
CALL FUNCTION 'HR_READ_INFOTYPE'
  EXPORTING
    pernr                 = '000000019'
    infty                 = '01'
    BEGDA                 = '18000101'
    ENDDA                 = '99991231'
  tables
    infty_tab             = p0008
  EXCEPTIONS
    INFTY_NOT_FOUND       = 1
    OTHERS                = 2
    LOOP AT p0008.
NOT SURE WHAT TO PUT IN THIS SECTION *****
  ENDLOOP.
I have created 3 additional Fields in the infoset Current FTE ,FTE1 FTE2 , and I want to loop through the records and populate the relevant Additional field with the employees FTE  (I only want to populate  where there is a change)
Sample Data
Begda              Endda             FTE        Salary
1/1/2010         31/12/999       60%         19K          (Current  FTE)
01/08/2009     31/12/2009     100%       27k           (FTE1)
01/07/2008     31/7/2009         50%       17K          (FTE2)
Thanks in anticipation
DM

Similar Messages

  • Transform sap query into transaction

    hi!
    my question is not related to mm but also not to other forums in this site.
    i'm trying to transform sap query into transaction using se93 transaction.
    i just learing sap in a class and we use an old version of sap.
    user group name: ofer6
    infoset name: ofer9
    query name: ofer8
    all created in global area
    when i enter se93 i write t-code ZSTART and press "create".
    then i choose: "transaction with parameters" in the popup window.
    in the second screen i write the transaction ZSTART again.
    i mark "skip initial screen" and "inherit gui attributes"
    at the bottom of the page in "default values" i use the following:
    D_SREPOVARI-EXTDREPORT     OFER8
    D_SREPOVARI-REPORT          OFER6 G
    D_SREPOVARI-REPORTTYPE     AQ
    when i press enter i get  messages:
    transaction ZSTART does not exist
    Screen 0000 of program  does not exist
    The field D_SREPOVARI-REPORTTYPE does not exist on the called screen
    The field D_SREPOVARI-REPORT does not exist on the called screen

    Hi,
    Please check the link below:
    http://www.freesaptutorial.com/how-to-create-transaction-code-in-sap-using-se93/
    Hope this will be helpful to you.
    Thanks,
    Neeraj

  • SAP Query Custom Field with ABAP Code

    Hi All,
    I have a custom field in my SAP query which has some ABAP code under it. The code finally writes some value to a variable. My question is do i need to explicitly link the variable in the ABAP code to the custom field OR it's done automatically. For some reason i don't see any value for this custom field. Thanks.

    Thanks Sandra

  • Sap Query Additional Fields using  Abap Code

    Hi Experts,
    I am relatively new to the world of SAP query (Log Database PNPCE), I have written a number of additional fields to retrieve previous info-type data using the select statement E.G
    prev_endda = p0008-begda - 1.
    SELECT  single bsgrd
          INTO FTE1
          FROM
            pa0008
          WHERE pernr EQ  P0008-pernr
          AND   endda EQ prev_endda
    Although I can retrieve the previous info-type data , I was wondering if there was a easy way where I could take this a step further and show the Previous , Previous record. I.E
    Pernr     FTE Current    FTE1      FTE2
    101              60%          30%       75%
    I guess what I am asking is , is there a way to loop through the HR info-type records, does anybody know if there is a standard function or macro I can use to achieve this.
    Your help is much appreciated.

    Hi ,
    Thanks for our reply.
    I have pasted some example code into my additional field which I have created in SAP Query But im not sure how the loop bit works and how I can populate the additional fields that I have created , could you please explain this
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        pernr                 = '000000019'
        infty                 = '01'
        BEGDA                 = '18000101'
        ENDDA                 = '99991231'
      tables
        infty_tab             = p0008
      EXCEPTIONS
        INFTY_NOT_FOUND       = 1
        OTHERS                = 2
        LOOP AT p0008.
    NOT SURE WHAT TO PUT IN THIS SECTION *****
      ENDLOOP.
    I have created 3 additional Fields in the infoset Current FTE ,FTE1 FTE2 , and I want to loop through the records and populate the relevant Additional field with the employees FTE  (I only want to populate  where there is a change)
    Sample Data
    Begda              Endda             FTE        Salary
    1/1/2010         31/12/999       60%         19K          (Current  FTE)
    01/08/2009     31/12/2009     100%       27k           (FTE1)
    01/07/2008     31/7/2009         50%       17K          (FTE2)
    Thanks in anticipation
    DM

  • Integrate Sap Query into ESS and MSS

    Hello
    I have been following this http://scn.sap.com/docs/DOC-50736;IDSactivation=99FDF6E06B5918D0293BF0BE7884FBCB0606A0F376FFD7908517BA7F2738E3A6
    for the intergration of SAP Query.
    However i am getting stuck at step 6 as it appears RP_MSS_CONVERT_MDT_TO_LPD_CUST
    does not exist and ideas what i am missing.
    So i have had to convert my MDT scenario using PWPC_CONV_MDT_TO_LPA
    From there i have then been able to run program APB_LPD_LPA_CUST_TO_LPD_CUST
    which has converted it into a launchpad in LPD_CUST, however once there it has no system alias defined for my applications so they won't launch and the launchpad entries for managers desktop don't give me a system alias option.
    Regards
    Adam

    Hi Adam,
    what release are you on? Do you use any Add-ons? The document you are following is written for EHP6, and I think MSS Add-On 1.0 is also needed as this add-on brings the WD ABAP applications for MSS.
    The report you don't have in your system is located in the WDA specific package for MSS, so I think it comes with the Add-on. The transaction you use for launchpad generation is the "old" one, that can be used from Enterprise Portal. Inside portal, you have a launchpad iView with properties for the scenario and the system alias.
    Do you have a possibility to install MSS Add-On 1.0? This should solve your problem and let you follow the guide.
    Regards,
    Marc

  • SAP Query format issue (with ABAP list)

    Hi All,
    I had a requirement to remove all unecessary formatting and text from a SAP query report which can be read by a third party software system. We need only Header line and  report data (spaced by Tab).
    I have removed all formatting from the report and changed the output format from "SAP list viewer" to "ABAP list" .
    The issue is that the report shows material number with 12 digits in output but when we download to file then it adds extra six "0" and makes the Material Number field as 18 digit.
    we have already maintained new length as 12 againts the standard length 18 for material number(under field output option)
    Please suggest how to get rid of extra digits generated during downloading.
    Please help,
    Thanks,
    Rohit

    Hi Brad,
    Currently we execute query with SQ01 and from the output screen the user direclty saves the file as "local file..."
    The output format is "abap list". We are able to get the exact format but the only problem is with material number. I cant make changes in the program. Is there a way to download it without changing the 12 character ( as displayed on the report output)
    Thanks for help.
    Rohit

  • Save sap query into file

    Hi,
    I am running my sap query and saving automaticaly into a file by using the 'file store' option. But i am running in background. I can see the result in the spool but how can i create the result in a TXT file directly.
    Thanks for your help.
    Regards,
    Cesar

    You have to give your application Path like "/USR/folder or /temp/filename.txt .. if you`re running in background .
    you can see the paths using Tr. AL11
    Thanks
    Saquib

  • Error While importing SAP query into quality system

    Hi,
    When Itried to import the dataset(Transport Request)  generated in develoment system into Quality system I am getting the following error.
    Query already exists and Infoset contains a structures which is not there in data dictionary .
    How to oversome this error to import successfully into quality system
    thanks

    hi,
    You need to transport your Z tables to the quality.
    Make sure you transport all the data elements , domain.. etc to the quality.
    Thats why its giving you the error.
    It does not find the Z tables in Quality
    Regards,
    Vinod

  • ABAP Reports and SAP Query

    Hi Experts,
    I have question regarding ABAP Reports, SAP Query, and Transaction with variant.  How are we securing one the above reports that we assign them through pfcg.  We can secure custom program by custom transaction or define the auth group in S_PROGRAM auth object but in this case we have to assign SA38 in production. is that correct?
    Please help me understand difference between the ABAP reports and SAP query. Is the ABAP reports same as Program or they are different.
    Thanks in advance
    Faisal
    Edited by: Faisal on Jun 30, 2009 11:06 PM

    Hi,
    1) End user security (role matrix coordinate with process team)
    This role Matrix design is most important where we can put restrictions and use SoD.
    2) Secure Table (by auth group)
    Table TDDAT and use of transaction se54 for security tables to right auth Groups. Secure s_tabu_dis, s_tabu_cli.
    3) Secure program (as you said ABAP reports are referred to Program)
    Use of table TPGP and program RSCSAUTH for assignment of groups to Program. SA38 Running of SA38 requires a minimum SUBMIT in user Action. A user having SA38 is dangerous as he/she is now enabled to run any report. Hence protection in Auth Group is needed. Verify each and every program is having authority check statement and Auth Group or not before assigning sa38. As you mentioned its best to avoid SA38 and create CUSTOM TXN for each report.
    (We should also SECURE S_DEVELOP in Production properly along with ur points. Please Note).
    4) Secure some batch jobs roles for batch job
    Secure by s_btch* objects and less access to se36.
    5) Create support roles for cutover activity during Go-live
    That is always needed. Go ahead.
    6) Emergency roles & IT roles for support
    This is very much needed as a role of Mitigation and Fire Fighting for Temporary access. Ensure to enable ur audit parameters in RZ10 (rsau* sm20,RSLG* for sm21). Give emergency access but enable audit via sm19 and get audit reports from sm20 and sm21 immediately after the use of emergency access.
    There are also other auth objects we need to be care ful which is a long list and hope every body ensures that (s_cts,a_admi,s_trans, tables ssm_cust, prgn,t000) etc and a host of others. Besh wishes. Let us know if any issue.
    Regards
    Aveek.

  • 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

  • FTP throgh abap

    Can anybody send me any code sample to execute FTP through ABAP..Points Guranteed.

    hi anid   this  may  be  helpful  for  u ....
    Source Code Listing
    REPORT ZKBTST32 LINE-SIZE 132.
    Test SAP FTP functions
    DATA: BEGIN OF MTAB_DATA OCCURS 0,
    LINE(132) TYPE C,
    END OF MTAB_DATA.
    DATA: MC_PASSWORD(20) TYPE C,
    MI_KEY TYPE I VALUE 26101957,
    MI_PWD_LEN TYPE I,
    MI_HANDLE TYPE I.
    START-OF-SELECTION.
    MC_PASSWORD = 'password'.
    DESCRIBE FIELD MC_PASSWORD LENGTH MI_PWD_LEN.
    *-- FTP_CONNECT requires an encrypted password to work
    CALL 'AB_RFC_X_SCRAMBLE_STRING'
         ID 'SOURCE' FIELD MC_PASSWORD ID 'KEY' FIELD MI_KEY
         ID 'SCR' FIELD 'X' ID 'DESTINATION' FIELD MC_PASSWORD
         ID 'DSTLEN' FIELD MI_PWD_LEN.
    CALL FUNCTION 'FTP_CONNECT'
         EXPORTING
           USER            = 'userid'
           PASSWORD        = MC_PASSWORD
           HOST            = 'servername'
           RFC_DESTINATION = 'SAPFTP'
         IMPORTING
           HANDLE          = MI_HANDLE
         EXCEPTIONS
           NOT_CONNECTED   = 1
           OTHERS          = 2.
    CHECK SY-SUBRC = 0.
    CALL FUNCTION 'FTP_COMMAND'
         EXPORTING
           HANDLE = MI_HANDLE
           COMMAND = 'dir'
         TABLES
           DATA = MTAB_DATA
         EXCEPTIONS
           TCPIP_ERROR = 1
           COMMAND_ERROR = 2
           DATA_ERROR = 3
           OTHERS = 4.
    IF SY-SUBRC = 0.
      LOOP AT MTAB_DATA.
        WRITE: / MTAB_DATA.
      ENDLOOP.
    ELSE.
    do some error checking.
    ENDIF.
    CALL FUNCTION 'FTP_DISCONNECT'
         EXPORTING
           HANDLE = MI_HANDLE
         EXCEPTIONS
           OTHERS = 1.
    Program Texts
    R FTP from SAP

  • Converting SAP Query to Report Program

    Hello Experts,
    I'm stuck up with an issue.
    I want to convert SAP query into a report program as the things which I need to implement is not possible with SAP Query anymore.
    So I need to convert SAP query to Report program.
    I'm very much aware about the SQ01--> Query --> More functions --> Display Report Program
    But this Report Program generates is AQ..................... but if you see the code there will be buch of dynamic calls not as clear as ABAP code and not much flexibility to modify...
    Please Provide a solution to this.
    Regards,
    Titiksha

    Hi Bhange,
    Glen Anthony has said very well and I support him. Even I suggest you to ignor the report generated with Query and develop a new report with the required business logic.
    Regards,
    Vijay

  • Declarations in SAP QUERY generated ABAP Programs

    hi,
    i had created a ABAP Program through ABAP Query (SQ01,SQ02,SQ03) but i have a issue that when i transport it to the PRD server i got the run time error. The Z program which i had created is the copy of the SQ01 generated program and i had done all the includes declarations in this program. but there is a problem that it is consist of the declarations of the structures,quries .
    I want to know is it necessary to always transport the Infoset and user group and the structure which is present in the program generated .
    Please provide me guidelines for this problem  .
    Edited by: ricx .s on Jul 6, 2009 5:31 AM
    Edited by: ricx .s on Jul 6, 2009 8:07 AM

    hi,
    i had copied the program bcoz i want to chekc that it is really necessary to transport the user group and infoset so that it can achieve functionality similar to the SAP QUERY.
    is there any other way without whichi can ahieve the functionality of SAP QUERY generated program and take it into the ABAP Porgram?

  • Bringing in Additional Fields into SAP Query

    Hi,
    I'm new to SAP Query. I had to modify an existing report to bring in an additional field from one of the tables of the query. When i look at the tables in query, i don't even see the field i would like to add under the table. I guess it needs to be first bring into query and later i can add. Can someone help me how to do this?
    Thanks in Advance.

    HI,
    IN SQ02, IF table is already in JOIN, just click on the PLUS sign to expand the strcture.
    All the field showing Plus sign in the strcture are selected in your query and with MINUS sing are no selected.
    So you have to just click on the MINUS sign for the field you want to use through table field.
    Generate the query and execute thriugh SQ01.
    If you want to add some other field which is not a part of JOIN,
    then click on EXTRAS Button shown in the MENU option.
    Click on Create button and system will ask abt the additional field.
    Regds,
    Anil

  • Adding the ABAP code to SAP Query to support Query's ALV Double click.

    Hi, Expert.
    I need to add some ABAP Code into SAP Query (or Infoset) to support the double click event on ALV cell of result of query.
    Is it possible & How to do ?
    Thank you very much.
    Best Regard
    Nattapash C.

    Hi, Gautham.
    I've put BREAK-POINT in all code section e.g. INITIALIZATION, END-OF-SELECTION..
    I found there are some section for add code that will be executed when query is processing before output data to ALV.
    What I need to know is Where I can input the code after ALV output. For support the Double Click Event on Query's ALV cell.
    Best Regard,
    Nattapash C.

Maybe you are looking for

  • Cell Definition in Query Designer

    Hi,, Can anyone will tell me the real time use of cell definition option in query designer. Thanks and Regards. Anjali

  • Choppy audio during cell phone call.

    Is anyone else having this problem? I'm on a cell phone call with 5 bars and after about a minute or so they start hearing me all choppy and that's with 5 AT&T bars. Is this a known issue? I don't see anything regarding this problem.

  • Cd-Rom is opening on Sony laptop

    Hi, I did buy a sony laptop 2 months ago. At the beginning CD-Rom was opening frequantly without any reason. Now its opening more often... Any ideas what is wrong??? Thank you!! Laptot is Sony 15"

  • Problem with changing tonality in CS5

    Hello, I recently upgraded to CS5 from CS3 after buying a new iMac. With CS5 I've been having this problem when I try to make certain images darker using levels, it just reverts back to the previous state and only gets darker very minimally. I even t

  • Battery Saver

    I just bought a new MacBook Pro and I want to know if there are any techniques I can use to extend the life of my battery. Any suggestions for the newbie?