Extracting spool no in ME21N

Hi Guys,
I have a requirement of saving a PO as a pdf locally while it is created and being saved, i used the BADI ME_PURCHDOC_POSTED and method POSTED to achieve this.
But when i open the PDF , i find that it saves the PO which was created earlier. Like for example PO421 is saved while 422 is created, This is due to the spool number in TSP01 is not updated till this save action is over. so it is picking up the last spool no and converting it into PDF.
I need to eliminate this and i need to know if i can find a spool no before it is updated in TSP01 or is their any other BADI which runs right immediately after the save option so that i can take the latest spool no.
All suggestions are greatly appreciated and rewarded.
Regards,
K

Hi Ken,
How are you creating the spool?
I'm assuming it is created via a smartform/sapscript program associated with an output type?
If that is the case you could perform your PDF processing within the program associated with the output type. The spool id is returned to you when you call a smartform in the job_output_info parameter.
Is that of any help or are you creating the spool via another means?
Regards,
Darren

Similar Messages

  • Extracting personal settings in ME21N

    I would like to extract the default values from personal settings in ME21N. Is there a function module to do this?

    Hi,
    Are you looking this FM ES_READ_USER_SETTINGS?
    Also you can check table ESDUS as well.
    Regards,
    Ferry Lianto

  • Extract spool file

    Hi,
    I have a problem with Adobe Form when i try to exract a 1 spool created with them.
    I  have a spool that contain more than 1 PDF file and I want extract it in only 1 PDF file.
    Is it possible ????
    How can I do that??
    Do u have some example to show me a solution ???
    Best regards.

    The Y* and Z* namespaces are reserved for end-users.  YDBN is a transaction custom to your site!

  • Extracting data into different flat files

    I am using oracle 10g.
    I've to run a very complex query that will extract/spool around 300 million records. It is so expensive to run the query multiple times. I want to run the query once but spool all the jobs into chunks of different files
    so for 300 million records, I want to split the records into 10 different files of 30 million records each. Is it possible to do so??
    Thanks

    Hello,
    Technically it doesn't make any sense and make it poor solution over spooling a file and then splitting. But if O/P comes back and says table is partitioned, now I can use 2 different solution (utl_file or spooling using sqlplus). I will then rely on shell script which will lauch query based on partition and spool a file, once done it close the file and opens a new one for next partition and so on.
    Regards.

  • To show the list in complete format when creating an background job

    Hi ,
    I need to show the list in full format when after running a report in background.
    In sm37 after the job run the the full list is not shown.
    when I click on 'Show complete list 'it will show the complete list.
    My requirement is I want this option in default .Is there any thing we can do by configuration or is there any chance of enhancement
    kindly help
    thanks and regards,
    Subeesh Kannottil

    Hi Subeesh,
    It is one of the standard setting provided by SAP for extracting spool output.In most of the case it is sufficient. Incase of special requirement we can do as below.
    In SM37,open the spool and click the icon Display in Maximum Width or (Shift+F4). Then the complete list will be displayed.
    Regards,
    Kannan

  • Extracting a Report from SAP Spool into a Useful Excel 2010 Format

    Hi All,
    Extracting a Report from SAP Spool into a Useful Excel 2010 Format.  I'm currently running the following report in SAP  and would like the
    ability to set this report up as a recurring report running weekly and
    subsequently access this report in a useable Excel 2010 format without
    much data manipulation.  Can you please assist me.  Below, I've tried to
    provide an example of what I'm encountering.   Thanks, beforehand for
    your assistance.
    Here goes:
    Step one: Run 62 Report in SAP S_P99_41000062- Material List Price and
    Inventory
    Step 2. Select stored Variant "Weekly KPI", ok. Enter the enter  the
    desired company code and period I want thre report to run for and update
    the currency, if necessary. Having input my desired criteria, I believe
    I can either execute immediately, run in the background, preset to run
    at date in the future. For this example let's just execute, immediately.
    This is where the difference originates. Given, I run this report
    immediately, I'm able to simply extract the result to Excel via the list
    selection noted in the tool bar below.  The result is a data friendly
    excel 2007  report is automatically generated.
    Export to Excel via list:
    Select save and Excel 2007 opens automatically:
    That said, the method outlined above works perfectly fine if you want
    the report immediately.  Now let go back and run the exact same report
    with exceptoin of running it in the background and having to retrieve it
    from the Spool (SP01) uisng my user ID.  Given the report generated in
    the background,  I would now access the report via the spool and make
    the following selections:
    SP01 + execute to see my report
    I would hit the sunglasses to see the actual report, then want to
    extract this report to Excel by selecting the export option.
    I would at this point select spreadsheet and be given an option to save
    the spreadsheet to local file. However, upon trying to open the
    spreadsheet I will receive an error messageindicating that the format is
    different than that which the file I am currently trying to open it
    with.  I'm currently running Excel 2010 on my computer.  The currency
    format and other issues arrise with this extract.  Please help. 
    Thanks,
    Chowadary.

    Update to Latest GUI.
    Use   List -> Export -> Spreadsheet  to get the output to excel.
    I remember in ALV max length allowed is 1023 characters and the max no of columns supported is 90. Issue occurs when row size of exported data gets more than 1023 character. (This includes if Long/Medium Header Text used ) If it exceed 1023 character the columns splits and moves to next row.
    Check your fieldcatog for header lengths.
    -Satya

  • Spooling Extracts from Multiple SQL statements in 1 File

    Hi all,
    I am trying to spool extract results of 3 separate SQL statements into one single file. I wrote a SQL block similar to the one below. However, the result of the statements overwrite each other: 3 overwrote 2 and overwrote 1. Any suggestion how to combined there extracted results in one file?
    spool c:\test.txt
    <SQL statement 1>
    <SQL statement 2>
    <SQL statement 3>
    /spool OFF
    Thanks in advance
    Jason

    Please paste you SQL file here. These is no way one should overwrite another.
    Eric

  • ME21N - Get output messages spool number

    Hi,
    I need some user exit or BADI that allow me to get the number of the spool object that will be available for output messages on TSP01 table after saving the PO in ME21N.
    I've tried to implement ME_PROCESS_PO_CUST method POST but have no idea is the spool is already available at this moment and how to get it number.
    Does anyone has already experienced something that could help me on this?
    Thanks in advance.
    Best regards,
    Hugo Braz

    Hi Dude,
      Try this..
    1. Go to txn. NACE...
    2. Choose the Application "EF" then clcik on "Output Types" button,
    3. Choose your output Type "NEU".. then double click on "Mail title and Text"
    4. Here please maintain "&EKKO-EBELN&"  under title field.
    From now onwards if you do print out the system will store the PO number in this field "RQTITLE" of table TSP01. So you can get the details of Spool no. against PO number.
    Regards
    GK.

  • YDBN - Extract Auto Payment: error message at spool file

    Hi,
    I run YDBN, Extract Auto Payment, and there is an error message at spool file as follows:
    WARNING  ##################
       Please check the DBERROR.TXT file     #
    Bene Account Length is too long.        #
    Does anyone know what is this?

    The Y* and Z* namespaces are reserved for end-users.  YDBN is a transaction custom to your site!

  • Is it possible to automate the extraction using spool command?

    Hi,
    I am trying to export data from table to excel. But the result i am getting will be in million records. Till now i am manually extracting the data using plsql developer. but it is hampering my work alot when i am extracting.
    i am able to extract the data using below spool command in sqlplus
    set feed off markup html on spool on
    spool 'd:\filename.xls'
    select * from ca_trial_milestones;
    spool off
    set markup html off spool off
    But is it possible to run it in sql/plsql developer and schedule it on night time.
    U r replies will help me alot.
    Thanks alot in advance

    981145 wrote:
    Hi,
    I am trying to export data from table to excel. But the result i am getting will be in million records. Till now i am manually extracting the data using plsql developer. but it is hampering my work alot when i am extracting.
    i am able to extract the data using below spool command in sqlplus
    set feed off markup html on spool on
    spool 'd:\filename.xls'
    select * from ca_trial_milestones;
    spool off
    set markup html off spool off
    But is it possible to run it in sql/plsql developer and schedule it on night time.
    U r replies will help me alot.
    Thanks alot in advanceYou can create a batch file in window and then setting appropriate environment setting you can do
    sqlplus user/pass@connect @scriptnamewhere scriptname is you above script.
    You can then schedule this in windows schduler
    However excel can not handle more than 1,048,576 rown as of version 2010
    You can save the spool as html file and you will able to view the resultset.

  • Extraction of oracle pkg and pkg bodies into spool file??

    Hi,
    I need to extract all packages and its bodies into spool file. can you give me script or guide how to do this.. i have more than 200 packages.. need to create spool file for each package. great thanks for help.
    /mr
    Edit/Delete Message

    From 10g, DBMS_METADATA is designed for ! :)
    [http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#i1019414]
    Edited by: Leo Anderson on 1 sept. 2008 14:22

  • Spool not getting generated in OO ALV report

    Hi,
    I developed a report in which we are giving output in same selection screen through OO ALV.
    But,when we are scheduling that report in background,spool is not getting generated.
    Waiting for your reply.
    BR,
    Praveen

    Hi Aparna,
    I tried NEW-PAGE PRINT ON.
    I am pasting source code extract below:
       IMPORT DATA = ME->IT_FINAL2 FROM MEMORY ID SY-CPROG.
        FREE MEMORY ID SY-CPROG.
        CHECK ME->IT_FINAL2 IS NOT INITIAL.
        CHECK LO_DOCK IS INITIAL.
        CREATE OBJECT LO_DOCK
          EXPORTING
            REPID = SY-REPID
            DYNNR = SY-DYNNR
            RATIO = 70
            SIDE  = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_BOTTOM
            NAME  = 'DOCK_CONT'.
        IF SY-SUBRC NE 0.
          MESSAGE 'Error in Docking Control' TYPE 'S'.
        ENDIF.
        IF LO_ALV IS INITIAL.
          TRY.
              LO_CONT ?= LO_DOCK.
              CALL METHOD CL_SALV_TABLE=>FACTORY
                EXPORTING
                  LIST_DISPLAY   = IF_SALV_C_BOOL_SAP=>FALSE
                  R_CONTAINER    = LO_CONT
                  CONTAINER_NAME = 'DOCK_CONT'
                IMPORTING
                  R_SALV_TABLE   = LO_ALV
                CHANGING
                  T_TABLE        = ME->IT_FINAL2.
            CATCH CX_SALV_MSG.
          ENDTRY.
      CLEAR LR_COLUMN.
          TRY.
              LR_COLUMNS = LO_ALV->GET_COLUMNS( ).
              LR_COLUMN = LR_COLUMNS->GET_COLUMN( 'KSCHL' ).
              LR_COLUMN->SET_LONG_TEXT( 'Cond.Type' ).
    CATCH CX_SALV_NOT_FOUND.
          ENDTRY.
    NEW-PAGE PRINT ON.
            LO_ALV->DISPLAY( ).
            NEW-PAGE PRINT OFF.
    I am not getting spool list while executing it in background.
    BR,
    Praveen

  • What happens to attachment in a PO when it is converted to PDF using SPOOL.

    Hi Experts,
    While converting a PO to PDF using a spool number, it works fine but i have a question as If the PO has an attachment, does the spool take care of that also?
    If not how to download the attachment as well.
    Thanks & Regards,
    K

    Hi Shan,
    No in ME21N there is a tab called Attachment, by which we can attach a note or something(I am thou not sure why this is done), yes a script is generated into a PDF but this attachment which is part of PO does it get attached or we need to do somthing to attach it to PDF was my question?
    Cheers,
    K
    Edited by: Ken Thompson on Sep 29, 2008 5:58 AM

  • Generate Insert Statement Script to Extract Data from Table in Oracle 7i

    Hi all, I have an old Oracle legacy system that is running for over 15 years.Every now and then we need to extract data from this table@ ORacle 7i to be imported back to Oracle 10G.
    My thoughts are to create a script of Insert statements in oracle 7 and that to be deployed back to Oracle 10G.
    I found this scripts in Google and not sure how exactly this works.Any explanation on thsi scripts , would be greatly appreciated.I find this scripst may help to generate a set of insert statements from that table to the latest table at 10G.
    <pre>
    -- Step 1: Create this procedure:
    create or replace Function ExtractData(v_table_name varchar2) return varchar2 As
    b_found boolean:=false;
    v_tempa varchar2(8000);
    v_tempb varchar2(8000);
    v_tempc varchar2(255);
    begin
    for tab_rec in (select table_name from user_tables where table_name=upper(v_table_name))
    loop
    b_found:=true;
    v_tempa:='select ''insert into '||tab_rec.table_name||' (';
    for col_rec in (select * from user_tab_columns
    where
    table_name=tab_rec.table_name
    order by
    column_id)
    loop
    if col_rec.column_id=1 then
    v_tempa:=v_tempa||'''||chr(10)||''';
    else
    v_tempa:=v_tempa||',''||chr(10)||''';
    v_tempb:=v_tempb||',''||chr(10)||''';
    end if;
    v_tempa:=v_tempa||col_rec.column_name;
    if instr(col_rec.data_type,'CHAR') > 0 then
    v_tempc:='''''''''||'||col_rec.column_name||'||''''''''';
    elsif instr(col_rec.data_type,'DATE') > 0 then
    v_tempc:='''to_date(''''''||to_char('||col_rec.column_name||',''mm/dd/yyyy hh24:mi'')||'''''',''''mm/dd/yyyy hh24:mi'''')''';
    else
    v_tempc:=col_rec.column_name;
    end if;
    v_tempb:=v_tempb||'''||decode('||col_rec.column_name||',Null,''Null'','||v_tempc||')||''';
    end loop;
    v_tempa:=v_tempa||') values ('||v_tempb||');'' from '||tab_rec.table_name||';';
    end loop;
    if Not b_found then
    v_tempa:='-- Table '||v_table_name||' not found';
    else
    v_tempa:=v_tempa||chr(10)||'select ''-- commit;'' from dual;';
    end if;
    return v_tempa;
    end;
    show errors
    -- STEP 2: Run the following code to extract the data.
    set head off
    set pages 0
    set trims on
    set lines 2000
    set feed off
    set echo off
    var retline varchar2(4000)
    spool c:\t1.sql
    select 'set echo off' from dual;
    select 'spool c:\recreatedata.sql' from dual;
    select 'select ''-- This data was extracted on ''||to_char(sysdate,''mm/dd/yyyy hh24:mi'') from dual;' from dual;
    -- Repeat the following two lines as many times as tables you want to extract
    exec :retline:=ExtractData('dept');
    print :retline;
    exec :retline:=ExtractData('emp');
    print :retline;
    select 'spool off' from dual;
    spool off
    @c:\t1
    -- STEP3: Run the spooled output c:\recreatedata.sql to recreate data.
    Source:http://www.idevelopment.info/data/Oracle/DBA_tips/PL_SQL/PLSQL_5.shtml
    </pre>

    Thanks Justin.
    I get what you are saying,i really wanted to see the output of the codes, because the furtherst i could get from that code is
    SELECT EXTRACTDATA('MYTABLE') FROM MYTABLE;
    and it generated this:
    "select 'insert into MYTABLE ('||chr(10)||'DATE1,'||chr(10)||'TIME1,'||chr(10)||'COUNTS) values ('||decode(DATE1,Null,'Null','to_date('''||to_char(DATE1,'mm/dd/yyyy hh24:mi')||''',''mm/dd/yyyy hh24:mi'')')||','||chr(10)||''||decode(TIME1,Null,'Null',TIME1)||','||chr(10)||''||decode(COUNTS,Null,'Null',COUNTS)||');' from MYTABLE;
    select '-- commit;' from dual;"
    "select 'insert into MYTABLE ('||chr(10)||'DATE1,'||chr(10)||'TIME1,'||chr(10)||'COUNTS) values ('||decode(DATE1,Null,'Null','to_date('''||to_char(DATE1,'mm/dd/yyyy hh24:mi')||''',''mm/dd/yyyy hh24:mi'')')||','||chr(10)||''||decode(TIME1,Null,'Null',TIME1)||','||chr(10)||''||decode(COUNTS,Null,'Null',COUNTS)||');' from MYTABLE;
    select '-- commit;' from dual;"
    "select 'insert into MYTABLE ('||chr(10)||'DATE1,'||chr(10)||'TIME1,'||chr(10)||'COUNTS) values ('||decode(DATE1,Null,'Null','to_date('''||to_char(DATE1,'mm/dd/yyyy hh24:mi')||''',''mm/dd/yyyy hh24:mi'')')||','||chr(10)||''||decode(TIME1,Null,'Null',TIME1)||','||chr(10)||''||decode(COUNTS,Null,'Null',COUNTS)||');' from MYTABLE;
    select '-- commit;' from dual;"
    "select 'insert into MYTABLE ('||chr(10)||'DATE1,'||chr(10)||'TIME1,'||chr(10)||'COUNTS) values ('||decode(DATE1,Null,'Null','to_date('''||to_char(DATE1,'mm/dd/yyyy hh24:mi')||''',''mm/dd/yyyy hh24:mi'')')||','||chr(10)||''||decode(TIME1,Null,'Null',TIME1)||','||chr(10)||''||decode(COUNTS,Null,'Null',COUNTS)||');' from MYTABLE;
    select '-- commit;' from dual;"
    "select 'insert into MYTABLE ('||chr(10)||'DATE1,'||chr(10)||'TIME1,'||chr(10)||'COUNTS) values ('||decode(DATE1,Null,'Null','to_date('''||to_char(DATE1,'mm/dd/yyyy hh24:mi')||''',''mm/dd/yyyy hh24:mi'')')||','||chr(10)||''||decode(TIME1,Null,'Null',TIME1)||','||chr(10)||''||decode(COUNTS,Null,'Null',COUNTS)||');' from MYTABLE;
    select '-- commit;' from dual;"
    "select 'insert into MYTABLE ('||chr(10)||'DATE1,'||chr(10)||'TIME1,'||chr(10)||'COUNTS) values ('||decode(DATE1,Null,'Null','to_date('''||to_char(DATE1,'mm/dd/yyyy hh24:mi')||''',''mm/dd/yyyy hh24:mi'')')||','||chr(10)||''||decode(TIME1,Null,'Null',TIME1)||','||chr(10)||''||decode(COUNTS,Null,'Null',COUNTS)||');' from MYTABLE;
    select '-- commit;' from dual;"
    I was expecting a string of
    insert into mytable values (19/1/2009,1,1);
    insert into mytable values (19/10/2008,5,10);
    Thanks for the explanation .

  • How to extract the column width in ALv report if its executed in background

    I am executing an ALV report in background , in front end i am getting data properly, in back end for some columns some of the digits are missing.For example if PO no is of 10 digits it will display only 8 becos column size is like that , how to extract coulmns in back ground.
    I have executed in background and checked the spool and  for some of the columns width is not sufficient to display comeplete data so please suggest how to extract the columns sizes if executed inj background for an ALV

    Hi Deepthi,
    you can try with the above mentioned suggestions ,if its worked its fine ,
    If not use Docking container instead of custom container, For ALV in back ground jobs, its suggest to use docking container instead of custom container , below you can find the declaration for docking container and code to use docking and custom container in your program for fore and back ground.
    or you can use docking container alone for both operations.
    Data : G_DOCK1 TYPE REF TO CL_GUI_DOCKING_CONTAINER,
    IF CCON IS INITIAL. (ccon is container name )
    *Check whether the program is run in batch or foreground
        IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
    *Run in foreground
          CREATE OBJECT CCON
            EXPORTING
              CONTAINER_NAME = 'CON1'.
        CREATE OBJECT GRID1
            EXPORTING
              I_PARENT = parent_1.
    ELSE.
    *Run in background
          CREATE OBJECT GRID1
            EXPORTING
              I_PARENT = G_DOCK1.
        ENDIF.
      ENDIF.
    B&R,
    Saravana.S

Maybe you are looking for

  • How do I install Windows?

    I have a new MacBook Air, purchased with Lion and Boot Camp 4 already installed. All firmware is up to date. I have a legal version of Windows 7 Ultimate supplied with two DVDs, one for 64 bit and one for 32 bit which I purchased because Boot Camp wo

  • Paid app no longer in app store what to do?

    bought an app from the app store .... Mega Poker Online Texas Holdem (75K Edition), v1.3.7 (12 ) and i had to resore my ipod and the app was not in the app store will apple credit my account the 1.99,i tryed to report it but i cant cuz the app is not

  • ASM and Dataguard

    Hi, can we make asm database (i.e. database is managing by asm disk groups) as primary database in one server and configure secondary database in another server.

  • Best practice on drivers update

    How to update driver? There are so many different types mode of computers. update drives with inf or exe?

  • Program Error : Labview.ex​e has generated errors,,et​c? Any Ideas

    I keep getting this error popup titled Program Error.  The message reads, "LabView.exe has generated errors and will be closed by Windows. You will need to restart the program. An error log is being created."  This appears to happen randomly includin