Create a Z extractor writing a code in SE37 calling FM READ_TEXT

Hello,
Could you please help me in the following case?
I need to extract the material sales text.
I have created a structure in SE 11 using the fields VKORG, MATNR, VTWEG, ZSTXT.
Then I am in SE37 building a Z function module, but I do not know how to write in the source code something that calls READ_TEXT properly. What I have for the moment is writen below. Also in the tabs of FM in SE37: Import, Export, Changing, Tables and Exception I am not sure what to fill.
Could you please help?
Thanks & Regards,
Adriana Oliveira
FORM first_call TABLES   P_I_T_SELECT STRUCTURE ZZSALES_TEXT
                         P_I_T_FIELDS STRUCTURE I_T_FIELDS
                USING    P_I_REQUNR
                         P_I_INITFLAG
                         P_I_DSOURCE
                         P_I_MAXSIZE
                CHANGING P_S_S_IF.
DATA : git_memo1 TYPE STANDARD TABLE OF tline,
       g_name1   LIKE thead-tdname,
       gwa_memo1    TYPE tline.
loop at s_matnr.
          CONCATENATE  s_matnr-low g_vkorg c_00 INTO g_name1.
        CALL FUNCTION 'READ_TEXT'
           EXPORTING
                id                      = '0001'
                language                = PT
                name                    = g_name1
                object                  = 'MVKE'
           TABLES
                lines                   = git_memo1
           EXCEPTIONS
                id                      = 1
                language                = 2
                name                    = 3
                not_found               = 4
                object                  = 5
                reference_check         = 6
                wrong_access_to_archive = 7
                OTHERS                  = 8.
               loop at git_memo1 into gwa_memo1.
                write :/0(20) s_matnr-low,25(60) gwa_memo1-TDLINE.
               endloop.
endloop.

I would like to answer your question in 2 steps
1) How to create a generic extractor using FM
This weblog will explain you everything
Generic Extraction via Function Module
I feel u should start from scratch builing your FM as u need to make a copy of the standard FM make a copy of the standard fm 'RSAX_BIW_GET_DATA_SIMPLE'.
This will solve your questions regarding Import, Export, Changing, Tables and Exception
2) How to use READ_TEXT fm
I'll give u an extract of the code u need.Basically u need to use init_text before u use read_text.
   CONCATENATE <f_mvke>-matnr <f_mvke>-vkorg <f_mvke>-vtweg INTO w_name RESPECTING BLANKS.
*Get Sales Text
    CALL FUNCTION 'INIT_TEXT'
      EXPORTING
        ID       = '0001'
        LANGUAGE = sy-langu
        NAME     = w_name
        OBJECT   = 'MVKE'
      TABLES
        LINES    = it_lines
      EXCEPTIONS
        ID       = 1
        LANGUAGE = 2
        NAME     = 3
        OBJECT   = 4
        OTHERS   = 5.
    IF SY-SUBRC = 0.
      REFRESH it_lines.
      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          CLIENT                  = sy-mandt
          ID                           = '0001'
           LANGUAGE           = sy-langu
           NAME                    = w_name
           OBJECT                 = 'MVKE'
        TABLES
           LINES                   = it_lines
        EXCEPTIONS
            ID                               = 1
            LANGUAGE                = 2
            NAME                        = 3
            NOT_FOUND              = 4
            OBJECT                  = 5
            REFERENCE_CHECK         = 6
            WRONG_ACCESS_TO_ARCHIVE = 7
            OTHERS                  = 8.
   IF sy-subrc = 0.
Populate the required fields by reading from it_lines
*as it_lines is a table not just a variable
   ENDIF.
ENDIF.
Hope this helps you to proceed.

Similar Messages

  • To avoid writing database code in the front end

    Hello,
    I am working on a database application using 10g database as backend and dotnet as front end. I wish to execute only oracle stored procedure for all the select (to avoid hard parse and use of bind variable), DDL and DML operations; just to avoid writing database code in the front end. Can anyone please give me a little examples of :
    1.Select query's output to be return as resultset by stored procedure.
    2.DML example by stored procedure.
    3.Any DDL example by stored procedure.
    using scott.emp, so that i would just call the stored procedure, rather than giving select,DML and/or DDL commands in the front end. Even though i have read in the documentation, but a clear cut examples will help me to get into clear concept as well.
    Thanks & Regards
    Girish Sharma

    Hi...
    -->Select example
    create or replace procedure get_emp(rc out sys_refcursor)
    is
    begin
    open rc for select * from emp;
    end;
    -->DML example
    create or replace procedure do_dml_emp(pempid in number,
    pempname varchar2,
    result out number)
    is
    begin
    insert into emp(empid,empname) values(pempid,pempname) returning empid into result;
    exception
    when others then
    result:=-1;
    end;
    -->DDL example
    create or replace procedure ddl_emp(colname varchar2,
    coltype varchar2,
    result out number)
    is
    begin
    result:=-1;
    execute immediate 'alter table emp add column ' || colname || ' ' || coltype ;
    result:=1;
    end;

  • Writing most code in RDBMS

    I have few queries regarding the use of Stored Procedures, Functions
    and Triggers in an RDBMS.
    (1) When to use Stored Procedure? Writing an INSERT query in a Stored
    Procedure is better or firing it from the application level?
    (2) Can a Trigger call a Stored Procedure?
    (3) What type of code must reside in application and what type in
    RDBMS?
    (4) Is it faster to work at application level or at the database level?

    1) An insert statement is an insert statement, won't be faster from one place or the other. See bottom..
    2) Yes, a trigger can call a stored procedure or package or function..
    3) "Must" reside? This is a BIG question, and there's not a perfect answer. See bottom..
    4) If the work can be done at the database level, it's usually faster to do it there. Lots of reasons PL/SQL is great, but the lack of network lag induced by data movement back and forth to an application usually gives PL/SQL a large lead in application performance.
    How to design an application, and when to use application code versus database calls to PL/SQL is a large design issue. Do you have (and plan to keep) the trained manpower to enhance and maintain a PL/SQL environment? Lots of places have investment iin Java programmers, or ASP, or python/perl/C++/etc. and don't want to switch.
    And do you want to tie yourself to one product. PL/SQL is Oracle ONLY.. no migrating to another database if a client demands it. Not important if you are doing it for an internal app, but hugely important if you produce software to sell.
    And, last, is PL/SQL the right choice for your application? I've written a lot of PL/SQL with great success, but I've also written lots of C/C++ code, Perl, Java, 4th party products, etc. because those languages fulfilled our application and environment needs. To make a good design, you need an experienced application architect or at least analyst to help you.
    Now, in general.. here's my two bits. If you have a lot of data manipulation that needs done, or if you want to create standardized data interfaces to keep SQL out of your app, put all of your DML into PL/SQL packages. For the first point, doing the work in the database is very often more efficient than moving the data back and forth to the application to manipulate it. And for the second point, we've reduced application maintenance by a tremendous amount by putting all SQL into PL/SQL packages/functions/procedures (easier to recompile a package than to recompile and redistribute new binaries).
    Good book to get and read would be Tom Kyte's book, "Effective Oracle by Design".
    Good luck!

  • Data type mismatch while writing a code in BADi

    Hi Experts,
    While writing a code in BADi, I am facing data type mismatch.
    Scenario:
    I have created the Infospoke based on one ODS and inside BADi i am looking up the other ODS fields.
    Two ODS's having 4 common key fields but one key field having the data type mismatch.
    While selecting the data from other ODS table in where condition it's giving the error data type mismatch.
    Could you please advice the same please.
    Thanks.
    Gana.

    Any update please....
    Thanks in advance.
    Edited by: Gananadha Lenka on Jun 18, 2010 1:57 PM

  • Writing a Batch Input or Call Transaction program for transaction code MMAM

    Hi All,
    I'm writing a Batch Input or Call Transaction program for transaction code MMAM (Changing Material Type). The program was able to run but somehow I was not able to capture the log of the output after running MMAM. The log was not part of the SY-MESSAGE so adding in MESSTAB into call transaction doesn't help while BDC session logs shows only the transaction was processed.
    Anyone has encounter such problems before?
    Regards,
    Ramu.

    Hi
    Overview of Batch Input Session
    The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program. i am giving you example for Change Vendor you practice for ur tcode
    For our example, we will use the “Change Vendor” transaction (“FK02”) to add a street address to an already existing vendor.
    Step #1
    Use “System&#61664;Status” menu path to determine online program name (SAPMF02K), screen number (0110)
    Step #2
    Use “F1” key and “Technical Info” pushbutton in each screen field to be filled to determine the field name.
    Step #3
    Determine how to proceed in the transaction
    (save the record by clicking on the ‘Save’ pushbutton or pressing the ‘F11’ key).
    The process flow of CALL TRANSACTION
    A program that uses CALL TRANSACTION USING to process legacy data should execute thefollowing steps:
    Prepare a BDCDATA structure for the transaction that you wish to run.
    Prepare a internal table to store error messages Tab_Mess like structure of BDCMSGCOLL.
    With a CALL TRANSACTION USING statement, call the transaction and prepare the BDCDATA structure. For example:
    CALL TRANSACTION ‘MM01' USING BDCDATA MODE 'A' UPDATE 'S'. MESSAGES INTO TAB_MESS.
    IF SY-SUBRC <> 0.
    <Error_handling>.
    ENDIF.
    Overview of Batch Input Session
    The first batch input method is to create a batch input session. It is the processing of this batch input session that updates the database, not the execution of the batch input program

  • Problem in creating a Generic Extractor on a custom 'Z' table

    This is regarding an earlier question I posted in sdn today. I am trying to create a generic extractor on a custom 'Z' table and iam getting the following message.
    Invalid extract structure template YBW_Z3PVR of DataSource YCNA_3PVAR_RPT
    Message no. R8359
    Diagnosis
    You tried to generate an extract structure with the template structure Z3PVR. This operation failed, because the template structure quantity fields or currency fields, for example, field MENGE refer to a different table.
    Procedure
    Use the template structure to create a view or DDIC structure that does not contain the inadmissable fields.
    Please advise. how do i solve this?

    Hi there,
    Is your Z* table working? It must be add check field for quantity field and currency field.
    Hope this helps.

  • Creating a vendor invoice by t.code F-02 ...

    Hi All,
    Creating a vendor invoice by t.code F-02 and choosing the Posting Key 29, and the Special G/L Indicator "A", SAP selects automatically the Payment Block Key "A".
    Why does it happen?
    Could anyone advice me?
    Thanks
    Gandalf
    Edited by: Umberto Gandalf on Mar 4, 2009 5:30 PM

    Hi,
    In case of special G/L indicators for down payment, the payment block and due date are editable fields at the time of document entry so that it can then be used for processing by the automatic payment program.
    You can remove the block at the time of document entry.
    regards

  • Writing java code in JSP

    Hi All
    I dont know which one of the following is more effective in JSP
    writing java code like <% out.println("Hellooo "); %>
    OR
    writing like <%="hello" %>
    I shall be very much thankful to all those who spare their valuable time to clarify my doubt. I hope my question is not a stupid one.
    Thanks
    Elisha

    when both gives the same out put, why there are two for the same out put?Because it is easier to do this:
    Hello <%= userName %>
    than this:
    Hello <% out.println("userName"); %>
    Also there is a BIG difference in readability and maintainability of the JSP page. JSP pages are all about having html, and a few "fill in the blank" spots. The less <% scriptlet code %> you put on your JSP page, the better. If you want to run java code, do it in a servlet/bean.
    With the advent of JSTL, scriptlet code in JSPs should be a thing of the past.

  • Urgent : Doubt in writing a code in start routine

    Hi all ,
                 I am BI 7.0 system , I have doubt in writing a code in start routine .
    1) i have to extract the data first from a custom table based on one condition and then placing it into internal table .
    2) Now i have to loop at source_package for a particular region field say "ASIA". with this result i have to check for the correponding entries in custoom table .
       if condition is not true (i.e ) with entries or not matching then delete that particular record from source_package.
    i have written a small logic for this . but this is producing any ouput , Please check it and also let me know for modifications .
    thanks in advance.
    select * from zcsp
        into corresponding fields of TABLE itab_T
        where
        ZBUSINESSUNIT = 'BC'.
    loop at SOURCE_PACKAGE into ls_SOURCE_PACKAGE where /BIC/DPREGION = 'XE'.
                 loop at itab_t into itab_w where zcategory =
                   ls_source_package-/BIC/DPMAT/BIC/DPCAT.
                       if sy-subrc ne 0.
                         delete SOURCE_PACKAGE.
                       endif.
               endloop.
           endloop.

    You're deleting the entire input package.  You only want to delete the one row.
    DATA: g_tabix TYPE sy-tabix.
    SELECT * FROM zscp
    INTO CORRESPONDING FIELDS OF TABLE itab_t
    WHERE zbusinessunit = 'BC'.
    SORT itab_t BY zcategory.
    LOOP AT source_package INTO ls_source_package WHERE /bic/dpregion = 'XE'.
      g_tabix = sy-tabix.
      READ TABLE itab_t WITH KEY zcategory = ls_source_package-/bic/dpmat/bic/dpcat TRANSPORTING NO FIELDS BINARY SEARCH.
      IF sy-subrc NE 0.
        DELETE source_package INDEX g_tabix.
      ENDIF.
    ENDLOOP.

  • Writing web code on a Mac???? And FTP Programs?

    Alright, so bear with me on this one. I've been using mac's for years for my graphic design and graphic pieces of my web sites, but I still use my PC to write the code (HTML, JavaScript, CSS, mostly) that the sites run on. I write it, in true old-fashioned sense, in Notepad.
    However, now my overglorified word processor (PC) is being totally, ridiculously, slow and acting weird... I think it did this before my last Blue Screen of Death, so luckily I've backed up everything important. Anyway, I thought I'd give writing code on the Mac (a gorgeous 20" imac, in all its wondrous glory) a shot. Here's what I've done:
    - Open TextEdit, type in a few lines of test code.
    - Save As : select HTML as the file type, with a file name of "Test" or something.
    - Open the file in Safari, expecting to see a real, webpage. Instead? I see my code. Black text, white background, flaunting every little
    and tag like a defiant child smearing raspberry jam all over my couch.
    I just can't switch to a WYSIWYG editor and lose the (tyrannical) control I've had over my web pages from writing the code in notepad. So what should I be doing to write code on a mac? I need to know soon, since my PC will be exploding any day now. Any help would be GREATLY appreciated.
    P.S. I'd prefer not to have to spend any money to purchase a text editor for web code. Am I being cheap? I don't really know. But if I can use a program that's already on my mac, I'm all for it.
    P.P.S. Also, I've been uploading code/images/etc. to my hosts via the WinSCP FTP software, on a PC. Can anyone recommend good FTP software for OSX (10.4.10).

    Both of iFelix's suggestions are great free apps and I would recommend them also.
    If you don't mind shelling out some money for the apps (after a trial of course), I myself use Panic's Coda (http://www.panic.com/coda/) for coding. A lot of people also prefer apps like TextMate (http://macromates.com/).
    CSSEdit (http://macrabbit.com/cssedit/) is a really nice combination of a WYSIWYG and source editior strictly for CSS also (Coda has this sort of functionality built in also).
    As far as FTP, if you arent happy with the free options, Panic makes an app called Transmit (http://www.panic.com/transmit/) that is excellent, and is also basically built into Coda.
    Message was edited by: shadeDream

  • How to create PDF with Form Builder (T-Code:SPF) and how to use it?

    How to create PDF with Form Builder (T-Code:SPF) and how to use it? Is there anyone can show me some doc. or PA material ? << removed >>  Thank you very much!!
    Edited by: Rob Burbank on Nov 11, 2010 1:04 PM

    PDF forms also known as Adobe From or Interactive Forms.
    Check this link -
    Interactive Forms
    REG:ADOBE FORM
    Adobe forms
    Regards,
    Amit

  • KNB1 - Customer is creating in more than 2 company codes.

    Dear Developers,
    I have a unique isuue related to CRM -> R/3.
    I'm creating a customer in CRM system which  is replicated to R/3.
    while replication, the customer is picking up company code data(KNB1) from the reference customer. Here for the reference customer in R/3 we are maintaining 2 company code (Ex.CCUS & CCCA)
    My objective is to create customer for one company code depending on the sales organisation (KNVV-VKORG)
    Best solution will get reward points...
    Thanks in advance...<b></b><b></b><b></b><b></b>

    Dear Uwe Schieferstein 
    you almost reached my point.
    My client says that he will maintain more than 1 company code for the reference customer. while replication it should pick the appropriate company code from the sales organization.
    for example I'm replicating customer for US (IGUS) it should pick company code (IGUS) from reference customer.
    if I create for India(IGIN) the company code should be (IGIN).
    in the function module SD_CUSTOMER_MAINTAIN_ALL the reference customer comapny code details are fetched from the data base KNB1 and populated to Internal table.
    if the company codes are more than one all the badi's are triggered only once for the 1st loop. i.e., for the first company code. so, this is causing problem to override custom values.
    hope you understood my exact problem...
    please guide me in this regard.
    I promise full points for the successful solution.
    Best Regards,
    Srinivas

  • How to create a oracle database by java code?

    how to create a oracle database by java code?
    please give some ways then that way's code

    I'm not sure what you mean with "database". Do you mean an Oracle instance or an Oracle user/schema (probably the latter, because that's the equivalent to a MS SQL Database).
    Creating an instance is definitely not possible from within Java. To create a new user this should be possible, as this can be done with SQL:
    GRANT connect,resource TO <newuser> IDENTIFIED BY <password>;
    I'm always cautious with questions like this. In 90% of the cases there is something wrong with the initial design. Creating a database shouldn't be something the application is doing.
    Thomas

  • Create a generic extractor using Function module,  what steps must I follow

    Hello gurus team
    I need to Create a generic extractor using Function module,  what steps must I follow?
    Just I have a function module not estructures or something, only the program.... and I have intented to do it in rso2 using the fm option, but give an error... somebody can helpme???
    BR

    Hi,
    Generic Extraction via Function Module
    /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
    http://help.sap.com/saphelp_nw04/helpdata/en/86/1c8c3e94243446e10000000a114084/frameset.htm
    Thanks,
    JituK

  • How to create the generic extractors in sap R/3?,pabitra

    Hi,
         How to create the generic extractors in sap R/3?
    Though it comes under cross application and the types of generic extractors are functional module ,db view,infoset query etc.Do u think the g.e can be built of one of the is types.plz tell correctly
    Advance thanks
    regards
    pabitra

    Hi,
    this is for DB view ,
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm
    this is for infoset query,
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/cb43b2455611d189710000e8322d00/frameset.htm
    Good day,
    regards
    Arun

Maybe you are looking for

  • How do I create a title, that behaves like a button?

    Hi, I'm using XML to load data from asp to flash. Here's the XML example: 1. <?xml version="1.0" encoding="iso-8859-1"?> 2. <news> 3. <item> 4. <headline>Flash XML Based News reader out today!</headline> 5. <date>05/09/1986</date> 6. <message>Today m

  • PI 7.1 "content is now allowed in prolog"

    Hi, Did anyone face this error on PI 7.1: "content is now allowed in prolog" I am getting this error even with a simple file2file scenario in the CC monitoring->sender CC. any clue as to what is the cause? Thanks, Raghu

  • Windows installation disc keeps ejecting in 10.8

    Hi all I have got a late 2011 13-inch macbook pro running 10.8.2 and I am trying to install windows 8 onto it. But whenever I insert the installation disc into my disc drive, it will start to 'spin' the disc but then it ejects it without anything app

  • A Thought on FAQ's and Other Things

    I've been spending some time on the PE forum, since I added that program to my toolbox. Besides the FAQ's, which have been partially redone, since the forum changeover lost all of the old ones, but the MOD there, Steve Grisetti, there is also a Tip &

  • Since I downloaded os x10.8.2 I get a gray screen on my home page

    Since I downloaded os x10.8.2 I get a gray screen on my home page from time to time.Going to perferences to try to fix this small problem does not work . I have to restart my mac mini (mid July 2011)to temperly fix this. So I am looking for a permane