ME23N Import PO

Hi gurús,
              I have a problem with the tab "IMPORT" in a PO. In the field "container" doesn´t appear all the options in the matchcode. Just 2.
Where I can configure more options?
Regards enzo

With your brief description not to able to make which field or fiedls you are referring to under Import tab, but all configuration related to PO Import tabs are available under Foreign Trade data tab, check there..
SPRO -> Material Management -> Purchasing -> Foreign Trade

Similar Messages

  • Update the export import procedure in ME23n!!

    Hi,
    Is ther any exit/badi available which can be used for updating Export/Import Procedure for Foreign Trade ( EIPO-EXPRF) for transaction ME23n...
    Regards
    Gunjan

    ME23N is a display transaction not update.
    ME21N / ME22N / ME23N has a BADI that gives access to a lot of the PO data - ME_PROCESS_PO_CUST
    Note that this BADI has a number of methods with parameters defined as "Importing" which makes it look like you cannot change data, but some of these parameters are "TYPE REF TO" objects which themselves have methods such as GET_DATA and SET_DATA that actually allow you to access and change the fields.
    Search for previous posts including "ME_PROCESS_PO_CUST" - there is sample code in some of them.
    In transaction SE19, if you display the BADI then select menu option goto>sample code>display, you will be able to drill down on the PROCESS_ITEM method to some SAP supplied sample code.
    Andrew

  • Length error occured in IMPORT statement

    Hello everyone,
    i hv one requirment in PO print(ME23N). in po print asset no nt display without changing other format.
    so that i first copy both smartform and driver program, in that i made certain changes such that i declare the patameter p_ebeln and i comment to data statement of p_ebeln & p_ebeln = nest-objky.
    then i join asset no (anek-anln1) with the help of inner join. then in smartform i gave condition that if bsart = 'ZCAP'
    wa_final-anln1 = gv_anln1.
    endif.
    i import gv_anln1 in smartform and exported in deriver program.
    both are synthetically currect but when i gave print preview dump is occured.
    length error occured in IMPORT statement
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_IMPORT_MISMATCH_ERROR', was
         not caught in
        procedure "%GLOBAL_INIT" "(FORM)", nor was it propagated by a RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        During import the system discovered that the target object has
        a different length than the object to be imported.
    what i do?

    Hello,
    can u send me coding for that?
    program line is already created for that
    and their first coding is like that,
    if gv_bsart = 'ZCAP'.
    wa_final-matnr = space.
    endif.
    and in text they fetch matnr no.
    but as per requirement they want asset no when bsart = 'ZCAP'
    how that asset no will come.
    matnr comes there is bsart is other that ZCAP, but bsart = ZCAP they want asset no instead of matnr.

  • ABAP runtime error while doing ME21N, ME22N, ME23N, ME51N,ME52N, ME53N

    Dear All Expert,
    I am facing problem while doing ME21N, ME22N, ME23N, ME51N,ME52N, ME53N,
    Please find the below ABAP Runtime Error.
    Runtime Errors         LOAD_TYPE_VERSION_MISMATCH
    Date and Time          10.02.2011 11:13:07
    Short text
         Change of a Dictionary structure at runtime of a program.
    What happened?
         Runtime error
         The current ABAP program "CL_IM_WRF_MM_PROC_PO==========CP" had to be
          terminated because one
         of the statements could not be executed at runtime.
    What can you do?
         Restart the program.
         If the error persists, contact your SAP administrator.
         You can use the ABAP dump analysis transaction ST22 to view and manage
         termination messages, in particular for long term reference.
    Error analysis
         The ABAP runtime system detected that the Dictionary-type "WRF_POHF_KOMP_STY"
          changed
         during the flow of the transaction.
         As the type was already used in the old version
         and in the new type should be used in the same transaction in the new
          version, the transaction had to be cancelled to avoid inconsistencies.
    How to correct the error
        Try to restart the program.
    System environment
        SAP-Release 700
        Application server... "iqe"
        Network address...... "172.25.0.85"
        Operating system..... "Linux"
        Release.............. "2.6.9-55.ELsmp"
        Hardware type........ "x86_64"
        Character length.... 16 Bits
        Pointer length....... 64 Bits
        Work process number.. 0
        Shortdump setting.... "full"
        Database server... "iqe"
        Database type..... "ORACLE"
        Database name..... "IQE"
        Database user ID.. "SAPSR3"
        Terminal................. "MUMJML5727"
        Char.set.... "C"
        SAP kernel....... 700
        created (date)... "Dec 26 2010 20:17:07"
        create on........ "Linux GNU SLES-9 x86_64 cc3.3.3"
        Database version. "OCI_102 (10.2.0.2.0) "
    Patch level. 285
    Patch text.. " "
    Database............. "ORACLE 10.1.0.., ORACLE 10.2.0.., ORACLE 11.2...*"
    SAP database version. 700
    Operating system..... "Linux 2.6"
    Memory consumption
    Roll.... 16192
    EM...... 25139088
    Heap.... 0
    Page.... 40960
    MM Used. 8038136
    MM Free. 4528408
    User and Transaction
    Client.............. 600
    User................ "JKMM"
    Language key........ "E"
    Transaction......... " "
    Transactions ID..... "4D524AD1FD7A42F9E1000000AC190055"
    Program............. "CL_IM_WRF_MM_PROC_PO==========CP"
    Screen.............. " "
    Screen line......... " "
    Information on where terminated
        The termination occurred during generation of the ABAP/4 program
         "CL_IM_WRF_MM_PROC_PO==========CP".
        The termination occurred in line 213
        of the source code of program "CL_IM_WRF_MM_PROC_PO==========CM007" (when
         calling the editor 2130).
    Source Code Extract
    Line  SourceCde
      183   DATA: l_flag TYPE wrf_pbas_boolean.
      184
      185   CALL FUNCTION 'WRF_POHF_MSG_READ_PREVIEW_FLAG'
      186     IMPORTING
      187       e_preview_flag = l_flag.
      188
      189   IF NOT l_flag IS INITIAL.
      190
      191     DATA: l_header TYPE REF TO cl_po_header_handle_mm.
      192
      193     MOVE im_header ?TO l_header.
      194
      195     CALL METHOD l_header->if_output_mm~preview( ).
      196
      197     CALL FUNCTION 'WRF_POHF_MSG_RESET_PREV_FLAG'.
      198
      199 ***$ Widening Cast for printing information.
      200 **    CALL FUNCTION 'WRF_POHF_STORE_PRINT_INFO_SET'
      201 **      EXPORTING
      202 **        im_header = l_header.
      203
      204 * Printing Preview
      205 * IF NOT gv_preview IS INITIAL.
      206 *    CALL METHOD l_header->if_output_mm~overview( ).
      207 *    CALL METHOD l_header->if_output_mm~preview( ).
      208 * clear gv_preview.
      209   ENDIF.
      210
      211 *  ENDIF.
      212
    >>>>> ENDMETHOD.
    Internal notes
        The termination was triggered in function "ab_RxDdicStruShareFailed"
        of the SAP kernel, in line 2539 of the module
         "//bas/700_REL/src/krn/runt/abtypload.c#11".
        The internal operation just processed is " ".
        Internal mode was started at 20110210111306.
        Name of the changed type......: "WRF_POHF_KOMP_STY"
        New version of the type.......: 20070508193207
        Old version of the type.......: 20070508193207
        New user......................: "Type" "WRF_POHF_KOMP_STY"
        Version of the new user.......: 20070508193207
        Old user......................: "???" "???"
        Version of the old user.......: "???"
    Active Calls in SAP Kernel
    Lines of C Stack in Kernel (Structure Differs on Each Platform)
    (CTrcStack2+0x78)[0x6cbb78]
    (CTrcStack+0xb)[0x6cc17b]
    (ab_rabax+0x3be5)[0xb8d985]
    (_Z24ab_RxDdicStruShareFailedPKtm4RUDIS0_S1_S0_+0x163)[0xb16823]
    (_Z19ab_GetDdicTypeIndexPKtm4RUDI+0x1f6)[0xb0dbb6]
    (_Z11ab_LoadViewPtjPKtPK11PROGRAMHEADPj+0x27e)[0xb16ede]
    (_Z18ab_GetDdicTypeLoad4RUDI+0x6e)[0xb1705e]
    (ab_GetView+0xc1d)[0xb0ee1d]
    (_Z20CompressInitRcByDatajPK6CG_DIRjjS1_jj4RUDIPKhj+0x60d)[0xe32b2d]
    (_Z21cg_CompressStackFrameP4TRIGjj+0x169)[0xe33399]
    (_Z8cg_blkleP3ENV+0x75f)[0xe4779f]
    (_Z9sc_cblklePKt8ENV_KINDP7SC_INFO+0x394)[0xe90024]
    (sc_blkle+0xdd)[0xec6e4d]
    (rs_oper_abap1729+0x37)[0x10eb237]
    (rs_expan_abap+0xa1996)[0xfd7a2a]
    (_Z8sc_expanj+0x76d)[0xe1d55d]
    (_Z5parsejPi+0x258)[0xe19998]
    (sc_check+0xb9c)[0xe1857c]
    (sc_inclu+0x5fa)[0xe0d50a]
    (rs_oper_abap2160+0x3a)[0x1115d6a]
    (rs_expan_abap+0xcd41d)[0x10034b1]
    (_Z8sc_expanj+0x76d)[0xe1d55d]
    (_Z5parsejPi+0x258)[0xe19998]
    (sc_check+0xb9c)[0xe1857c]
    (sc_checkStart+0x41)[0xe1ac51]
    (cg_generate+0xb65)[0xe57755]
    (ab_gabap+0x14a)[0xb01a5a]
    (dy_gen_abap+0x63c)[0x74428c]
    (ab_genprog+0x13d3)[0xb03d13]
    (_Z17ab_LoadProgOrTrfoPKtjPj+0xb56)[0x8f9ab6]
    (_Z11ab_LoadProgPKtj+0x11)[0x8f9ca1]
    (_Z15LoadGlobalClassPKtjjj9ClasState+0x24c)[0x958c2c]
    (_Z11FillCfixIntPK4CREFP4CFIXjj9ClasState+0x214)[0x957404]
    (_Z11ab_FillCfixtj+0x65)[0x957ae5]
    (_Z26ab_CrefToCladId_ActivateOKtPh+0x7d)[0x957b6d]
    (_Z8ab_jaboov+0x623)[0x959793]
    (_Z8ab_extriv+0x607)[0x8ba9c7]
    (_Z9ab_xeventPKt+0x1c1)[0xa1c021]
    (_Z8ab_triggv+0x9c)[0xa1c77c]
    (ab_run+0x97)[0xbde5c7]
    (N_ab_run+0x9)[0x736359]
    (dynpmcal+0x669)[0x7333b9]
    (dynppai0+0x8eb)[0x734d9b]
    (dynprctl+0x3e9)[0x733db9]
    (dynpen00+0x4a5)[0x726eb5]
    (Thdynpen00+0x359)[0x541bd9]
    (TskhLoop+0xc49)[0x54d999]
    (ThStart+0x20f)[0x55b29f]
    (DpMain+0x2da)[0x4bd49a]
    (nlsui_main+0x9)[0x4910c9]
    (main+0x33)[0x491103]
    /lib64/tls/libc.so.6(__libc_start_main+0xdb)[0x3cde51c3fb]
    Please help me to resolve the issue.
    Thanks & Regards
    SKK

    read this part again:  The ABAP runtime system detected that the Dictionary-type "WRF_POHF_KOMP_STY" changed during the flow of the transaction. As the type was already used in the old version and in the new type should be used in the same transaction in the new version, the transaction had to be cancelled to avoid inconsistencies. How to correct the error Try to restart the program
    how often had you restarted ME21N before you posted this message?
    In best case this message appears only once, because the program / or dictionary was changed while you executed ME21N
    If many times, then contact your ABAPer, because then he probably did not transport all objects that were changed, or the objects have to be regenerated in your system.

  • Table for MM (Purchase- ME23N) Tax

    Hi friends,
    In my Report, I have to calculate & Display,  Material Purchase taxes.
    ( In ME23N --> Item --> Invoice -->Taxes AND ME23N --> Item -->Conditions)
    Can I have any Condition table for this entries (Like for SD & CS we have transparant table KONV)
    How can I display it?
    Regards,
    Ashlesha

    REPORT zreport10 .TABLES : ekko , ekpo , t001 , komk , komp . DATA mwsbp TYPE komp-mwsbp . PARAMETERS : p_ebeln TYPE ekpo-ebeln , p_ebelp TYPE ekpo-ebelp .START-OF-SELECTION . PERFORM calculate_tax USING p_ebeln p_ebelp CHANGING mwsbp . WRITE mwsbp .
    FORM calculate_tax *
    FORM calculate_tax USING p_ebeln TYPE ekpo-ebeln
    p_ebelp TYPE ekpo-ebelp
    CHANGING p_mwsbp TYPE komp-mwsbp . CONSTANTS: bstyp-info VALUE 'I',
    bstyp-ordr VALUE 'W',
    bstyp-banf VALUE 'B',
    bstyp-best VALUE 'F',
    bstyp-anfr VALUE 'A',
    bstyp-kont VALUE 'K',
    bstyp-lfpl VALUE 'L',
    bstyp-lerf VALUE 'Q'. DATA : taxcom TYPE taxcom ,
    t_konv TYPE TABLE OF komv WITH HEADER LINE .
    DATA: BEGIN OF tkomv OCCURS 50.
    INCLUDE STRUCTURE komv.
    DATA: END OF tkomv. DATA: BEGIN OF tkomvd OCCURS 50. "Belegkonditionen
    INCLUDE STRUCTURE komvd.
    DATA: END OF tkomvd. DATA : BEGIN OF tkomvh OCCURS 50.
    INCLUDE STRUCTURE komv.
    DATA : vtext LIKE t685t-vtext.
    DATA : END OF tkomvh. SELECT SINGLE *
    INTO ekko
    FROM ekko
    WHERE ebeln = p_ebeln . SELECT SINGLE *
    INTO ekpo
    FROM ekpo
    WHERE ebeln = p_ebeln
    AND ebelp = p_ebelp . SELECT SINGLE *
    INTO t001
    FROM t001
    WHERE bukrs = ekko-bukrs . taxcom-bukrs = ekpo-bukrs.
    taxcom-budat = ekko-bedat.
    taxcom-waers = ekko-waers.
    taxcom-kposn = ekpo-ebelp.
    taxcom-mwskz = ekpo-mwskz.
    taxcom-txjcd = ekpo-txjcd.
    taxcom-shkzg = 'H'.
    taxcom-xmwst = 'X'.
    IF ekko-bstyp EQ bstyp-best.
    taxcom-wrbtr = ekpo-netwr.
    ELSE.
    taxcom-wrbtr = ekpo-zwert.
    ENDIF. taxcom-lifnr = ekko-lifnr.
    taxcom-land1 = ekko-lands.
    taxcom-ekorg = ekko-ekorg.
    taxcom-hwaer = t001-waers.
    taxcom-llief = ekko-llief.
    taxcom-bldat = ekko-bedat.
    taxcom-matnr = ekpo-ematn.
    taxcom-werks = ekpo-werks.
    taxcom-bwtar = ekpo-bwtar.
    taxcom-matkl = ekpo-matkl.
    taxcom-meins = ekpo-meins. IF ekko-bstyp EQ bstyp-best.
    taxcom-mglme = ekpo-menge.
    ELSE.
    IF ekko-bstyp EQ bstyp-kont AND ekpo-abmng GT 0.
    taxcom-mglme = ekpo-abmng.
    ELSE.
    taxcom-mglme = ekpo-ktmng.
    ENDIF.
    ENDIF.
    IF taxcom-mglme EQ 0.
    taxcom-mglme = 1000.
    ENDIF.
    taxcom-mtart = ekpo-mtart. IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF. CALL FUNCTION 'J_1BSA_COMPONENT_ACTIVE'
    EXPORTING
    bukrs = ekko-bukrs
    component = 'BR'
    EXCEPTIONS
    component_not_active = 1
    OTHERS = 2. IF sy-subrc IS INITIAL. komk-mandt = ekko-mandt.
    komk-kalsm = ekko-kalsm.
    IF ekko-kalsm = ''.
    komk-kalsm = 'RM0000'.
    ENDIF.
    komk-kappl = 'M'.
    komk-waerk = ekko-waers.
    komk-knumv = ekko-knumv.
    komk-lifnr = ekko-lifnr.
    komp-kposn = ekpo-ebelp.
    komp-matnr = ekpo-matnr.
    komp-werks = ekpo-werks.
    komp-matkl = ekpo-matkl.
    komp-infnr = ekpo-infnr.
    komp-evrtn = ekpo-konnr.
    komp-evrtp = ekpo-ktpnr.
    CALL FUNCTION 'RV_PRICE_PRINT_ITEM'
    EXPORTING
    comm_head_i = komk
    comm_item_i = komp
    language = 'E'
    TABLES
    tkomv = tkomv
    tkomvd = tkomvd.
    CALL FUNCTION 'J_1B_NF_PO_DISCOUNTS'
    EXPORTING
    i_kalsm = ekko-kalsm
    i_ekpo = ekpo
    IMPORTING
    e_ekpo = ekpo
    TABLES
    i_konv = t_konv. IF NOT ekko-llief IS INITIAL.
    taxcom-lifnr = ekko-llief.
    ENDIF. ENDIF. CALL FUNCTION 'FIND_TAX_SPREADSHEET'
    EXPORTING
    buchungskreis = t001-bukrs
    EXCEPTIONS
    not_found = 1
    OTHERS = 2. CALL FUNCTION 'CALCULATE_TAX_ITEM'
    EXPORTING
    i_taxcom = taxcom
    IMPORTING
    e_taxcom = taxcom
    EXCEPTIONS
    mwskz_not_defined = 1
    mwskz_not_found = 2
    mwskz_not_valid = 3
    steuerbetrag_falsch = 4
    country_not_found = 5
    OTHERS = 6. IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF. p_mwsbp = taxcom-wmwst .
    ENDFORM. " calculate_tax

  • Purchase order fro import material.

    we have a bdc to create info record for import materials, which includes total 15 conditions.
    when we try to create po w r t this info record, we found that some of condition's are not adopted from info record. can you please help me to solve this problem  why the po is not fetching conditions from info record.

    Hello,
    In the Item Conditions tab in ME23N, click the button 'Analysis'.  Expand each Condition type node and drill down to see why condition record could not be fetched.
    Thanks,
    Venu

  • Transfer Foreign Trade Export Import values in Purchase Order

    Hello SRM brothers and sisters,
    I have a question regarding the transfer of the Import/Export data (Foreign Trade) in the PO from SRM to ECC in the Classic Extended Scenario.
    Basically, in the SRM BBP_ECS_PO_OUT_BADI -> BBP_B46B_PO_OUTBOUND method where we map all the values, I try to fill in the CT_BAPI_POEXPIMPITEM table with the item's Import/Export values.
    The way this is done is:
    if nothing exists in this CT_BAPI_POEXPIMPITEM table for the PO item, add an empty line and assign the following fields ( PO_ITEM, EXPORT_IMPORT_PROCEDURE, COUNTRYORI and COMM_CODE).
    This is then sent to ECC via the RFC BBP_PO_INBOUND function module - and inside I know that it assigns the X-structure of Export/Import Item. It then calls the BAPI_PO_CREATE / BAPI_PO_CHANGE and in the debugger the values seem to be correct.
    This all seems to be very nice, however when I take a look at the PO in ME23n, the values of the Import/Export data are not there! In table EIPO there is also nothing... As for error messages, nothing comes up either.
    So, has this happened to anyone? Am I doing something wrong? Is there an extra step I should do (ie, fill another structure/table/field)?
    Cheers,
    Adi

    Hi Kishor,
    Thanks for your reply.I need to some more inputs if you can...
    As you mention :-You need to enter the special UOM according to the specifications in the index of goods or foreign trade statistics: can you give a example to get more clarification.and how Qtys. are converted to this unit for the export declaration.
    You mentionwd : (FOr each item, you have to enter the amount of the unit of measure determined
    in the index of goods. Eg: number of units) -can u explain with example. what is index of Goods.
    Thanks in adavance.
    Thank you.
    Regards
    Amar

  • Asset import purchase order

    Hi expert
    While doing migo for asset Import Purchase order i  am getting valuation class error for account keys FR3  " account determination for entry FR3 not possible"
    my question is does how does i link the asset po to valuation class, in OBYC we requires valuation class and G/L account.
    Regard
    Nabil

    Dear Sayed,
    In obyc for transaction key FR3 you have to maintain G/L account for custom clearing.
    If you want to know how its working then go to me23n and at item level click on conditions tab and then click "Analysis" where you will able to find pricing procedure which is used in perticular PO ....then go to M/08 and find out that pricing procedure,select the same and click on control,you will find FRE key linked to some of your condition type...so for that it is not able to find G/L as it is not linked in OBYC so it is throwing above error.
    Linked reqd G/L in OBYC with help of FI consultant.
    Naren

  • Problem in Import PO pritout

    Hi,
      I have one problem   for import PO printing documen tcurrency in USD  for on PO  in line item price   the amount is coming as   4.7185  dollar which is OK   but in another PO insted of 3.900  Dollar  it is printing it as 3,9000    even though  the user settinf in OWN Dta is OK  it is decimal notation X  and also in ME23N  it is showing as 3.9000  but in printing it is displaying as 3,900 
    can you help on this issue,  I have search SDN  but all reply are asking for checking of Decinal notation  which is already  OK
      regards,
       zafar

    Hi,
    We are using customize program in NEU output type only  also price field is OK  and we are facing this problem in some PO only.
    regards,
    zafar

  • How to Read Texts in ME22N or ME23N to PO Print Form

    Hi Anybody,
          I want read  ItemText, Info Record POText, Material POText, Delivery Text... from ME22N or ME23N in Smartforms from Each PO Item and Print into PO Print  Form.
    Can u please anybody answer me.
    Thanks,
    S.Muthu.

    Hi this will help u.
    *&  Include           ZMFM06PE02
      Smart Form Print Routines                                          *
    form entry_neu using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      data: ls_print_data_to_read type lbbil_print_data_to_read.
      data: ls_bil_invoice type lbbil_invoice.
      data: lf_fm_name            type rs38l_fnam.
      data: ls_control_param      type ssfctrlop.
      data: ls_composer_param     type ssfcompop.
      data: ls_recipient          type swotobjid.
      data: ls_sender             type swotobjid.
      data: lf_formname           type tdsfname.
      data: ls_addr_key           like addr_key.
      xscreen = ent_screen.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
    Fill up pricing condition table if calling from ME9F
      if l_doc-xtkomv is initial.
        select * into table l_doc-xtkomv from konv
                                         where knumv = l_doc-xekko-knumv.
      endif.
    *Set the print Parameters
      perform set_print_param using     ls_addr_key
                              changing  ls_control_param
                                        ls_composer_param
                                        ls_recipient
                                        ls_sender
                                        ent_retco.
    *Get the Smart Form name.
      if not tnapr-sform is initial.
        lf_formname = tnapr-sform.
      else.
        lf_formname = tnapr-fonam.
      endif.
    Determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting
                formname           = lf_formname
           importing
                fm_name            = lf_fm_name
           exceptions
                no_form            = 1
                no_function_module = 2
                others             = 3.
      if sy-subrc <> 0.
    error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
      call function lf_fm_name
           exporting
                archive_index      = toa_dara
                archive_parameters = arc_params
                control_parameters = ls_control_param
                mail_recipient     = ls_recipient
                mail_sender        = ls_sender
                output_options     = ls_composer_param
                zxekko             = l_doc-xekko  " user_settings = ' '
                zxpekko            = l_doc-xpekko
           tables
                l_xekpo            = l_doc-xekpo[]
                l_xekpa            = l_doc-xekpa[]
                l_xpekpo           = l_doc-xpekpo[]
                l_xeket            = l_doc-xeket[]
                l_xtkomv           = l_doc-xtkomv[]
                l_xekkn            = l_doc-xekkn[]
                l_xekek            = l_doc-xekek[]
                l_xkomk            = l_xkomk
           exceptions
                formatting_error   = 1
                internal_error     = 2
                send_error         = 3
                user_canceled      = 4
                others             = 5.
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
    get SmartForm protocoll and store it in the NAST protocoll
        perform add_smfrm_prot.
      endif.
    endform.
    Mahnung
    form entry_mahn using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '3'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
    CALL FUNCTION 'ME_PRINT_PO'
          EXPORTING
               ix_nast        = l_nast
               ix_druvo       = l_druvo
               doc            = l_doc
               ix_screen      = ent_screen
               ix_from_memory = l_from_memory
               ix_toa_dara    = toa_dara
               ix_arc_params  = arc_params
          IMPORTING
               ex_retco       = ent_retco.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
    Fill up pricing condition table if calling from ME9F
      if l_doc-xtkomv is initial.
        select * into table l_doc-xtkomv from konv
                                         where knumv = l_doc-xekko-knumv.
      endif.
    *Set the print Parameters
      perform set_print_param using      ls_addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         ent_retco.
    *Get the Smart Form name.
      if not tnapr-sform is initial.
        lf_formname = tnapr-sform.
      else.
        lf_formname = tnapr-fonam.
      endif.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting
                formname           = lf_formname
           importing
                fm_name            = lf_fm_name
           exceptions
                no_form            = 1
                no_function_module = 2
                others             = 3.
      if sy-subrc <> 0.
    error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
      call function lf_fm_name
           exporting
                archive_index      = toa_dara
                archive_parameters = arc_params
                control_parameters = ls_control_param
                mail_recipient     = ls_recipient
                mail_sender        = ls_sender
                output_options     = ls_composer_param
                zxekko             = l_doc-xekko  " user_settings = ' '
                zxpekko            = l_doc-xpekko
           tables
                l_xekpo            = l_doc-xekpo[]
                l_xekpa            = l_doc-xekpa[]
                l_xpekpo           = l_doc-xpekpo[]
                l_xeket            = l_doc-xeket[]
                l_xtkomv           = l_doc-xtkomv[]
                l_xekkn            = l_doc-xekkn[]
                l_xekek            = l_doc-xekek[]
                l_xkomk            = l_xkomk
           exceptions
                formatting_error   = 1
                internal_error     = 2
                send_error         = 3
                user_canceled      = 4
                others             = 5.
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
    get SmartForm protocoll and store it in the NAST protocoll
        perform add_smfrm_prot.
      endif.
    endform.
    *eject
    Auftragsbestatigungsmahnung
    form entry_aufb using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '7'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
    CALL FUNCTION 'ME_PRINT_PO'
          EXPORTING
               ix_nast        = l_nast
               ix_druvo       = l_druvo
               doc            = l_doc
               ix_screen      = ent_screen
               ix_from_memory = l_from_memory
               ix_toa_dara    = toa_dara
               ix_arc_params  = arc_params
          IMPORTING
               ex_retco       = ent_retco.
      if nast-adrnr is initial.
        perform get_addr_key changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
    Fill up pricing condition table if calling from ME9F
      if l_doc-xtkomv is initial.
        select * into table l_doc-xtkomv from konv
        where knumv = l_doc-xekko-knumv.
      endif.
    *Set the print Parameters
      perform set_print_param using    ls_addr_key
                              changing ls_control_param
                                       ls_composer_param
                                       ls_recipient
                                       ls_sender
                                       ent_retco.
    *Get the Smart Form name.
      if not tnapr-sform is initial.
        lf_formname = tnapr-sform.
      else.
        lf_formname = tnapr-fonam.
      endif.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting
                formname           = lf_formname
           importing
                fm_name            = lf_fm_name
           exceptions
                no_form            = 1
                no_function_module = 2
                others             = 3.
      if sy-subrc <> 0.
    error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
      call function lf_fm_name
           exporting
                archive_index      = toa_dara
                archive_parameters = arc_params
                control_parameters = ls_control_param
                mail_recipient     = ls_recipient
                mail_sender        = ls_sender
                output_options     = ls_composer_param
                zxekko             = l_doc-xekko  " user_settings = ' '
                zxpekko            = l_doc-xpekko
           tables
                l_xekpo            = l_doc-xekpo[]
                l_xekpa            = l_doc-xekpa[]
                l_xpekpo           = l_doc-xpekpo[]
                l_xeket            = l_doc-xeket[]
                l_xtkomv           = l_doc-xtkomv[]
                l_xekkn            = l_doc-xekkn[]
                l_xekek            = l_doc-xekek[]
                l_xkomk            = l_xkomk
           exceptions
                formatting_error   = 1
                internal_error     = 2
                send_error         = 3
                user_canceled      = 4
                others             = 5.
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
    get SmartForm protocoll and store it in the NAST protocoll
        perform add_smfrm_prot.
      endif.
    endform.
    *eject
    Lieferabrufdruck fur Formular MEDRUCK mit Fortschrittszahlen
    form entry_lphe using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_xfz,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '9'.
      l_xfz = 'X'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
      perform set_print_param using      ls_addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         ent_retco.
    *Get the Smart Form name.
      if not tnapr-sform is initial.
        lf_formname = tnapr-sform.
      else.
        lf_formname = tnapr-fonam.
      endif.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
           importing  fm_name            = lf_fm_name
           exceptions no_form            = 1
                      no_function_module = 2
                      others             = 3.
      if sy-subrc <> 0.
      error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
    move the value
      move-corresponding l_doc-xekko to l_zekko.
      move-corresponding l_doc-xpekko to l_xpekko.
      l_xekpo[] = l_doc-xekpo[].
      l_xekpa[] = l_doc-xekpa[].
      l_xpekpo[] = l_doc-xpekpo[].
      l_xeket[] = l_doc-xeket[].
      l_xtkomv[] = l_doc-xtkomv[].
      l_xekkn[] = l_doc-xekkn[].
      l_xekek[] = l_doc-xekek[].
    *l_xaend[]    = l_doc-xaend[].
      call function lf_fm_name
        exporting
         archive_index              = toa_dara
      ARCHIVE_INDEX_TAB          =
         archive_parameters         = arc_params
         control_parameters         = ls_control_param
      MAIL_APPL_OBJ              =
         mail_recipient             = ls_recipient
         mail_sender                = ls_sender
         output_options             = ls_composer_param
         user_settings              = ' '
          zxekko                     = l_zekko
          zxpekko                    = l_xpekko
      l_xaend                    = l_xaend
       IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        tables
          l_xekpo                    = l_xekpo
          l_xekpa                    = l_xekpa
          l_xpekpo                   = l_xpekpo
          l_xeket                    = l_xeket
          l_xtkomv                   = l_xtkomv
          l_xekkn                    = l_xekkn
          l_xekek                    = l_xekek
          l_xkomk                    = l_xkomk
       l_xaend                    = l_xaend
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
        perform add_smfrm_prot.
      endif.
    endform.
    *eject
    Lieferabrufdruck fur Formular MEDRUCK ohne Fortschrittszahlen
    form entry_lphe_cd using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = '9'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
      perform set_print_param using      ls_addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         ent_retco.
      lf_formname = tnapr-fonam.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
           importing  fm_name            = lf_fm_name
           exceptions no_form            = 1
                      no_function_module = 2
                      others             = 3.
      if sy-subrc <> 0.
      error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
    move the value
      move-corresponding l_doc-xekko to l_zekko.
      move-corresponding l_doc-xpekko to l_xpekko.
      l_xekpo[] = l_doc-xekpo[].
      l_xekpa[] = l_doc-xekpa[].
      l_xpekpo[] = l_doc-xpekpo[].
      l_xeket[] = l_doc-xeket[].
      l_xtkomv[] = l_doc-xtkomv[].
      l_xekkn[] = l_doc-xekkn[].
      l_xekek[] = l_doc-xekek[].
    l_xaend[]    = l_doc-xaend[].
      call function lf_fm_name
        exporting
         archive_index              = toa_dara
      ARCHIVE_INDEX_TAB          =
         archive_parameters         = arc_params
         control_parameters         = ls_control_param
      MAIL_APPL_OBJ              =
         mail_recipient             = ls_recipient
         mail_sender                = ls_sender
         output_options             = ls_composer_param
         user_settings              = ' '
          zxekko                     = l_zekko
          zxpekko                    = l_xpekko
      l_xaend                    = l_xaend
       IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        tables
          l_xekpo                    = l_xekpo
          l_xekpa                    = l_xekpa
          l_xpekpo                   = l_xpekpo
          l_xeket                    = l_xeket
          l_xtkomv                   = l_xtkomv
          l_xekkn                    = l_xekkn
          l_xekek                    = l_xekek
          l_xkomk                    = l_xkomk
       l_xaend                    = l_xaend
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
        perform add_smfrm_prot.
      endif.
    endform.
    *eject
    Feinabrufdruck fur Formular MEDRUCK mit Fortschrittszahlen
    form entry_lpje using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_xfz,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = 'A'.
      l_xfz = 'X'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
      perform set_print_param using      ls_addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         ent_retco.
      lf_formname = tnapr-fonam.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
           importing  fm_name            = lf_fm_name
           exceptions no_form            = 1
                      no_function_module = 2
                      others             = 3.
      if sy-subrc <> 0.
      error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
    move the value
      move-corresponding l_doc-xekko to l_zekko.
      move-corresponding l_doc-xpekko to l_xpekko.
      l_xekpo[] = l_doc-xekpo[].
      l_xekpa[] = l_doc-xekpa[].
      l_xpekpo[] = l_doc-xpekpo[].
      l_xeket[] = l_doc-xeket[].
      l_xtkomv[] = l_doc-xtkomv[].
      l_xekkn[] = l_doc-xekkn[].
      l_xekek[] = l_doc-xekek[].
    l_xaend[]    = l_doc-xaend[].
      call function lf_fm_name
        exporting
         archive_index              = toa_dara
      ARCHIVE_INDEX_TAB          =
         archive_parameters         = arc_params
         control_parameters         = ls_control_param
      MAIL_APPL_OBJ              =
         mail_recipient             = ls_recipient
         mail_sender                = ls_sender
         output_options             = ls_composer_param
         user_settings              = ' '
          zxekko                     = l_zekko
          zxpekko                    = l_xpekko
      l_xaend                    = l_xaend
       IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        tables
          l_xekpo                    = l_xekpo
          l_xekpa                    = l_xekpa
          l_xpekpo                   = l_xpekpo
          l_xeket                    = l_xeket
          l_xtkomv                   = l_xtkomv
          l_xekkn                    = l_xekkn
          l_xekek                    = l_xekek
          l_xkomk                    = l_xkomk
       l_xaend                    = l_xaend
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
        perform add_smfrm_prot.
      endif.
    endform.
    *eject
    Feinabrufdruck fur Formular MEDRUCK ohne Fortschrittszahlen
    form entry_lpje_cd using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      l_druvo = 'A'.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
      perform set_print_param using      ls_addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         ent_retco.
      lf_formname = tnapr-fonam.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
           importing  fm_name            = lf_fm_name
           exceptions no_form            = 1
                      no_function_module = 2
                      others             = 3.
      if sy-subrc <> 0.
      error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
    move the value
      move-corresponding l_doc-xekko to l_zekko.
      move-corresponding l_doc-xpekko to l_xpekko.
      l_xekpo[] = l_doc-xekpo[].
      l_xekpa[] = l_doc-xekpa[].
      l_xpekpo[] = l_doc-xpekpo[].
      l_xeket[] = l_doc-xeket[].
      l_xtkomv[] = l_doc-xtkomv[].
      l_xekkn[] = l_doc-xekkn[].
      l_xekek[] = l_doc-xekek[].
    l_xaend[]    = l_doc-xaend[].
      call function lf_fm_name
        exporting
         archive_index              = toa_dara
      ARCHIVE_INDEX_TAB          =
         archive_parameters         = arc_params
         control_parameters         = ls_control_param
      MAIL_APPL_OBJ              =
         mail_recipient             = ls_recipient
         mail_sender                = ls_sender
         output_options             = ls_composer_param
         user_settings              = ' '
          zxekko                     = l_zekko
          zxpekko                    = l_xpekko
      l_xaend                    = l_xaend
       IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        tables
          l_xekpo                    = l_xekpo
          l_xekpa                    = l_xekpa
          l_xpekpo                   = l_xpekpo
          l_xeket                    = l_xeket
          l_xtkomv                   = l_xtkomv
          l_xekkn                    = l_xekkn
          l_xekek                    = l_xekek
          l_xkomk                    = l_xkomk
       l_xaend                    = l_xaend
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
        perform add_smfrm_prot.
      endif.
    endform.
    *eject
      INCLUDE FM06PE02                                                   *
    form entry_neu_matrix using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '1'.
      else.
        l_druvo = '2'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
      perform set_print_param using      ls_addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         ent_retco.
      lf_formname = tnapr-fonam.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
           importing  fm_name            = lf_fm_name
           exceptions no_form            = 1
                      no_function_module = 2
                      others             = 3.
      if sy-subrc <> 0.
      error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
    move the value
      move-corresponding l_doc-xekko to l_zekko.
      move-corresponding l_doc-xpekko to l_xpekko.
      l_xekpo[] = l_doc-xekpo[].
      l_xekpa[] = l_doc-xekpa[].
      l_xpekpo[] = l_doc-xpekpo[].
      l_xeket[] = l_doc-xeket[].
      l_xtkomv[] = l_doc-xtkomv[].
      l_xekkn[] = l_doc-xekkn[].
      l_xekek[] = l_doc-xekek[].
    l_xaend[]    = l_doc-xaend[].
      call function lf_fm_name
        exporting
         archive_index              = toa_dara
      ARCHIVE_INDEX_TAB          =
         archive_parameters         = arc_params
         control_parameters         = ls_control_param
      MAIL_APPL_OBJ              =
         mail_recipient             = ls_recipient
         mail_sender                = ls_sender
         output_options             = ls_composer_param
         user_settings              = ' '
          zxekko                     = l_zekko
          zxpekko                    = l_xpekko
      l_xaend                    = l_xaend
       IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        tables
          l_xekpo                    = l_xekpo
          l_xekpa                    = l_xekpa
          l_xpekpo                   = l_xpekpo
          l_xeket                    = l_xeket
          l_xtkomv                   = l_xtkomv
          l_xekkn                    = l_xekkn
          l_xekek                    = l_xekek
          l_xkomk                    = l_xkomk
       l_xaend                    = l_xaend
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
        perform add_smfrm_prot.
      endif.
    endform.
    *eject
    Angebotsabsage
    form entry_absa using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      l_druvo = '4'.
      clear ent_retco.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
      perform set_print_param using      ls_addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         ent_retco.
      lf_formname = tnapr-fonam.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
           importing  fm_name            = lf_fm_name
           exceptions no_form            = 1
                      no_function_module = 2
                      others             = 3.
      if sy-subrc <> 0.
      error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
    move the value
      move-corresponding l_doc-xekko to l_zekko.
      move-corresponding l_doc-xpekko to l_xpekko.
      l_xekpo[] = l_doc-xekpo[].
      l_xekpa[] = l_doc-xekpa[].
      l_xpekpo[] = l_doc-xpekpo[].
      l_xeket[] = l_doc-xeket[].
      l_xtkomv[] = l_doc-xtkomv[].
      l_xekkn[] = l_doc-xekkn[].
      l_xekek[] = l_doc-xekek[].
    l_xaend[]    = l_doc-xaend[].
      call function lf_fm_name
        exporting
         archive_index              = toa_dara
      ARCHIVE_INDEX_TAB          =
         archive_parameters         = arc_params
         control_parameters         = ls_control_param
      MAIL_APPL_OBJ              =
         mail_recipient             = ls_recipient
         mail_sender                = ls_sender
         output_options             = ls_composer_param
         user_settings              = ' '
          zxekko                     = l_zekko
          zxpekko                    = l_xpekko
      l_xaend                    = l_xaend
       IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        tables
          l_xekpo                    = l_xekpo
          l_xekpa                    = l_xekpa
          l_xpekpo                   = l_xpekpo
          l_xeket                    = l_xeket
          l_xtkomv                   = l_xtkomv
          l_xekkn                    = l_xekkn
          l_xekek                    = l_xekek
          l_xkomk                    = l_xkomk
       l_xaend                    = l_xaend
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
      if sy-subrc <> 0.
        ent_retco = sy-subrc.
        perform protocol_update_i.
        perform add_smfrm_prot.
      endif.
    endform.
    *eject
    Lieferplaneinteilung
    form entry_lpet using ent_retco ent_screen.
      data: l_druvo like t166k-druvo,
            l_nast  like nast,
            l_from_memory,
            l_doc   type meein_purchase_doc_print.
      data: l_zekko like ekko,
            l_xpekko like pekko,
            l_xekpo like table of ekpo,
            l_wa_xekpo like ekpo.
      data: l_xekpa like ekpa occurs 0,
            l_wa_xekpa like ekpa.
      data: l_xpekpo  like pekpo occurs 0,
            l_wa_xpekpo like pekpo,
            l_xeket   like table of eket with header line,
            l_xekkn  like table of ekkn with header line,
            l_xekek  like table of ekek with header line,
            l_xekeh   like table of ekeh with header line,
            l_xkomk like table of komk with header line,
            l_xtkomv  type komv occurs 0,
            l_wa_xtkomv type komv.
      data: ls_addr_key           like addr_key.
      clear ent_retco.
      if nast-aende eq space.
        l_druvo = '5'.
      else.
        l_druvo = '8'.
      endif.
      call function 'ME_READ_PO_FOR_PRINTING'
           exporting
                ix_nast        = nast
                ix_screen      = ent_screen
           importing
                ex_retco       = ent_retco
                ex_nast        = l_nast
                doc            = l_doc
           changing
                cx_druvo       = l_druvo
                cx_from_memory = l_from_memory.
      check ent_retco eq 0.
      if nast-adrnr is initial.
        perform get_addr_key
                             changing ls_addr_key.
      else.
        ls_addr_key = nast-adrnr.
      endif.
      perform set_print_param using      ls_addr_key
                                changing ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         ent_retco.
    *Get the Smart Form name.
      if not tnapr-sform is initial.
        lf_formname = tnapr-sform.
      else.
        lf_formname = tnapr-fonam.
      endif.
    determine smartform function module for invoice
      call function 'SSF_FUNCTION_MODULE_NAME'
           exporting  formname           = lf_formname
                    variant            = ' '
                    direct_call        = ' '
           importing  fm_name            = lf_fm_name
           exceptions no_form            = 1
                      no_function_module = 2
                      others             = 3.
      if sy-subrc <> 0.
      error handling
        ent_retco = sy-subrc.
        perform protocol_update_i.
      endif.
    move the value
      move-corresponding l_doc-xekko to l_zekko.
      move-corresponding l_doc-xpekko to l_xpekko.
      l_xekpo[] = l_doc-xekpo[].
      l_xekpa[] = l_doc-xekpa[].
      l_xpekpo[] = l_doc-xpekpo[].
      l_xeket[] = l_doc-xeket[].
      l_xtkomv[] = l_doc-xtkomv[].
      l_xekkn[] = l_doc-xekkn[].
      l_xekek[] = l_doc-xekek[].
      call function lf_fm_name
        exporting
         archive_index              = toa_dara
      ARCHIVE_INDEX_TAB          =
         archive_parameters         = arc_params
         control_parameters         = ls_control_param
      MAIL_APPL_OBJ              =
         mail_recipient             = ls_recipient
         mail_sender                = ls_sender
         output_options             = ls_composer_param
         user_settings              = ' '
          zxekko                     = l_zekko
          zxpekko                    = l_xpekko
      l_xaend                    = l_xaend
       IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        tables
          l_xekpo                    = l_xekpo
          l_xekpa                    = l_xekpa
          l_xpekpo                   = l_xpekpo
          l_xeket                    = l_xeket
          l_xtkomv                   = l_xtkomv
          l_xekkn                    = l_xekkn
          l_xekek                    = l_xekek
          l_xkomk                    = l_xkomk
    exceptions
       formatting_error           = 1
       internal_error             = 2

  • Create from ME22N, ME23N

    Hello,
    I need filled a new field with default value. This is doing in PBO of SAPLXM06 dynpro 0111.
    The problem is, i need fill this field only when purchase order is creating. I can check the sy-tcode, ME21N, however, from ME22N and ME23N this is possible push button new and in this case the SY-TCODE doesn't ME21N (it's ME22N or ME23N). The sy-ucomm is empty. How can i identified this case?
    Thanks,
    Regards,

    Hi Silvia
    I can uses the exit EXIT_SAPMM06E_016 or EXIT_SAPMM06E_017 in order to import the data from standard program to the user-exit, so data can be available for your screen-exit.
    In particular the 2 user-exit have the import parameter I_AKTYP in thei interface, this parameter indicate in which process it's PO:
    U can test its value by debug, but if I remember well:
    A = Display
    H = Create
    V = Change
    Anyway you should consider that screen-exit will be triggered only if the user will go there while creating PO, so if the user won't go there?
    Max

  • Why debugging updates data in ME23n but executing directly doesnt?

    Hi.
    While updating vendor material number through a customize report , ME23n doesnt get updated with vendor material number but text line does but when executed in debugging mode it does.
    BAP_PO_CREATE , we placed a bapi commit then a wait upto 2 sec. and also after BAPI_PO_CHANGE same thing thought of giving some time but doesnt work out.
    Any specific reason a program behaving differently.
    Regards
    Mohinder

    Hi ,
    CALL FUNCTION 'BAPI_PO_CREATE1'
        EXPORTING
          poheader         = wa_po_head
          poheaderx        = wa_po_headx
        IMPORTING
          exppurchaseorder = gv_po_number
        TABLES
          return           = gt_return
          poitem           = gt_poitem
          poitemx          = gt_poitemx
          poschedule       = gt_poschedule
          poschedulex      = gt_poschedulex
          poaccount        = gt_poaccount
          poaccountx       = gt_poaccountx
          potextitem       = gt_potextitem.
      COMMIT WORK AND WAIT.
    Then for ensuring ,
    IF gv_po_number IS NOT INITIAL.
        CALL FUNCTION 'BAPI_PO_CHANGE'
          EXPORTING
            purchaseorder = gv_po_number
          TABLES
            return        = gt_return
            poitem        = gt_poitem
            poitemx       = gt_poitemx.
      ENDIF.

  • How we know tables for komv, komk, komp structures in ME23n Trans for PO

    Hi gurus,
    We are extracting data of PO relating to me23n and sending that data to XI. Its working fine. But some fields value are getting wrong. I am getting problem with komv, komk, and komp structures, bcoz i dont know which tables i have to use. I am using konv right now.
    Pls give some suggestions.
    and also how we get netwr value in the header i.e. total amout of items and price element rate KOMV-KBETR in header.
    ex: KOMV-KBETR
         KOMK-WAERK
         KOMP-NETWR
         TDTEXT based on ID
         ZTEXT (item level text, and header level text).
    Thanks in advance...

    Pls see my code...
    *This for Header.............*
          i_zzep_pohdr_s-doc_date = i_ekko-bedat.    "14
          SELECT SINGLE * FROM t052 INTO i_t052 WHERE zterm = i_ekko-zterm.
          IF sy-subrc = 0.
            i_zzep_pohdr_s-pay_trms = i_t052-zterm.     "15
          ENDIF.
          SELECT SINGLE * FROM tcurc INTO i_tcurc WHERE waers = i_ekko-waers.
          IF sy-subrc = 0.
            i_zzep_pohdr_s-curr = i_tcurc-waers.     "16
          ENDIF.
          i_zzep_pohdr_s-ex_rate = i_ekko-wkurs.     "17
          i_zzep_pohdr_s-ex_rate_fxd = i_ekko-kufix. "18
          i_zzep_pohdr_s-inco = i_ekko-inco1.        "19
          i_zzep_pohdr_s-add_inco = i_ekko-inco2.    "20
          SELECT SINGLE * FROM t685t INTO i_t685t
          WHERE spras = i_ekko-spras.
          IF sy-subrc = 0.
            i_zzep_pohdr_s-pri_ele_cond_desc = i_t685t-vtext. "21
          ENDIF.
          SELECT SINGLE * FROM konv INTO i_konv WHERE knumv = i_ekko-knumv.
          IF sy-subrc = 0.
            IF i_konv-kschl = 'PBXX'.
    *          i_zzep_pohdr_s-Pri_ele_rate = i_konv-kbetr.                "22
              i_zzep_pohdr_s-pri_ele_curr_cond = i_konv-waers.           "23
              i_zzep_pohdr_s-pri_ele_cond_val_doc_curr = i_konv-kwert_k. "24
            ENDIF.
          ENDIF.
          MOVE i_ekko-ebeln TO xname.
          CALL FUNCTION 'READ_TEXT'
            EXPORTING
    *   CLIENT                        = SY-MANDT
              id                            = 'F02'
              language                      = sy-langu
              name                          = xname
              object                        = 'EKKO'
    *   ARCHIVE_HANDLE                = 0
    *   LOCAL_CAT                     = ' '
    * IMPORTING
    *   HEADER                        =
            TABLES
              lines                         = i_xtline
       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.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ELSE.
            CLEAR temp.
            LOOP AT i_xtline INTO rline.
              IF rline-tdline IS NOT INITIAL.
                CONCATENATE temp rline-tdline INTO temp SEPARATED BY space.
              ENDIF.
            ENDLOOP.
            MOVE temp TO i_zzep_pohdr_s-hdr_lvl_txt_cont . "28
          ENDIF.
          SELECT SINGLE * FROM t166k INTO i_t166k WHERE bsart = i_ekko-bsart.
          IF sy-subrc = 0.
            i_zzep_pohdr_s-hdr_lvl_txt_id = i_t166k-tdid.            "26
          ENDIF.
          SELECT SINGLE * FROM t166k INTO i_t166k WHERE bsart = i_ekko-bsart.
          IF sy-subrc = 0.
            SELECT SINGLE * FROM ttxot INTO i_ttxot WHERE tdobject = i_t166k-tdobject
                                                    AND tdspras = i_ekko-spras.
            IF sy-subrc = 0.
              i_zzep_pohdr_s-hdr_lvl_txt_desc_id = i_ttxot-tdtext. " 27
            ENDIF.
          ENDIF.
          APPEND i_zzep_pohdr_s TO t_zzep_pohdr_t.
        ENDLOOP.
    *This for Items.............*
    SELECT * FROM t166p INTO TABLE i_t166p WHERE bstyp = i_ekpo-bstyp
                                                  AND pstyp = i_ekpo-pstyp.
          IF sy-subrc = 0.
            LOOP AT i_t166p INTO wa_t166p.
              IF wa_t166p-tdid = 'F01'.
                i_zzep_podet_s-itm_lvl_txt_id = wa_t166p-tdid.            "29
              ENDIF.
            ENDLOOP.
            SELECT SINGLE * FROM ttxot INTO i_ttxot WHERE tdobject = 'EKPO'
                                                    AND tdspras = sy-langu.
            IF sy-subrc = 0.
              i_zzep_podet_s-itm_lvl_txt_desc_id = i_ttxot-tdtext. " 27
            ENDIF.
          ENDIF.
    *select single * from stxl into i_stxl where tdspras = i_ekko-spras.
    *select single * from
          APPEND i_zzep_podet_s TO t_zzep_podet_t.
          sum = sum + i_zzep_podet_s-pri_ele_net_val_doc_curr.
          CLEAR i_zzep_podet_s.
        ENDLOOP.
        CLEAR current_line.
        LOOP AT t_ekko INTO i_ekko.
          current_line = sy-tabix.
          LOOP AT t_ekpo INTO i_ekpo WHERE ebeln = i_ekpo-ebeln.
            IF sy-subrc = 0.
              *MOVE sum TO i_zzep_pohdr_s-pri_ele_net_val_doc_curr.* (NETWR)
              *MOVE sum TO i_zzep_pohdr_s-pri_ele_rate.* (KBETR)
            ENDIF.
          ENDLOOP.
          MODIFY t_zzep_pohdr_t FROM i_zzep_pohdr_s INDEX current_line.
        ENDLOOP.
      ENDIF.
    I already down althose wht u suggested previous...
    just see this code and give suggestion where i have to change my code....
    I am getting doubt when i am using ..
    IF i_konv-kschl = 'PBXX'.
                i_zzep_podet_s-pri_ele_rate = i_zzep_podet_s-ext_val_itm.                "25
                i_zzep_podet_s-pri_ele_curr_cond = i_konv-waers.           "26
                i_zzep_podet_s-pri_ele_cond_val_doc_curr = i_konv-kwert_k. "27
              ENDIF.
    and..
    CLEAR current_line.
        LOOP AT t_ekko INTO i_ekko.
          current_line = sy-tabix.
          LOOP AT t_ekpo INTO i_ekpo WHERE ebeln = i_ekpo-ebeln.
            IF sy-subrc = 0.
              MOVE sum TO i_zzep_pohdr_s-pri_ele_net_val_doc_curr.
              MOVE sum TO i_zzep_pohdr_s-pri_ele_rate.
            ENDIF.
          ENDLOOP.
          MODIFY t_zzep_pohdr_t FROM i_zzep_pohdr_s INDEX current_line.
        ENDLOOP.
      ENDIF.
    pls suggest me...
    thanks.
    Code Formatted by: Alvaro Tejada Galindo on Jan 7, 2009 12:49 PM

  • New Tab on header level for me21n/me22n/me23n

    Hi Friends
    i have created a new tab on the me21n/me22n/me23n  header level using the exit
    MM06E005 , The tab is displayed but i am not unable to udate the records into the
    EKKO  Table whereas i have added my field in the include of  EKKO  CL_EKKODB
    Kindly somebody help me with elaborated steps  .
    Thanks & Regards
    Digvijay Rai

    Hi Digvijay,
    Once the data is entered on the screen ..code is written to update the table ie...
    flow of data from custom screen for header is OK..but for display and change we need to
    import the data in a similar manner to the customer subscreen or the tab added in header level
    As you can see the following 3...code must be done in EXIT_SAPMM06E_006/007 to fetch data to customer subscreen for display/change actions..use 006/007 for PBO/PAI actions..
    EXIT_SAPMM06E_006   Export data to customer subscreen for header(PBO)....INCLUDE ZXM06U36
    EXIT_SAPMM06E_007   Export data to customer subscreen for header(PAI)....INCLUDE ZXM06U38 .
    EXIT_SAPMM06E_008   Import data from customer subscreen for header
    Pls check and revert..in addition
    go to smod->MM06E005-> "documentation" -> Display to read more on documentation about data flows and exits used for it
    Hope it helps
    Regards
    Byju

  • PO : ME23N

    Hi,
    in Tcode ME23N i display a PO (import), in the header of this PO i can show only the amounts (for delivery costs) for the foreign currency (column : condition value). But i want also show the amount with the local currency.
    Please advise
    Regards

    Hi ,
    Use  below fm to display currency in local currency or some other currency.
    CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY_N'
    EXPORTING
    client = sy-mandt
    date = p_ep_bldat   "Posting date or Document date
    foreign_amount = p_ep_hwbas       "Amount
    foreign_currency = c_eur   "Currency already program is showing like USD Or JPY
    local_currency = currency "Your To-Be Local currency
    RATE = 0
    type_of_rate = 'M'
    READ_TCURR = 'X'
    IMPORTING
    EXCHANGE_RATE =
    FOREIGN_FACTOR =
    local_amount = p_ep_hwbas "After converting value into TO-Be Currency
    LOCAL_FACTOR =
    EXCHANGE_RATEX =
    FIXED_RATE =
    DERIVED_RATE_TYPE =
    EXCEPTIONS
    no_rate_found = 1
    overflow = 2
    no_factors_found = 3
    no_spread_found = 4
    derived_2_times = 5
    OTHERS = 6 .
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Finally you will get value into p_ep_hwbas .
    Pass parameters accordingly.definitely it will work.
    For correct conversion rates you have to maintain entries in OB08 transaction.
    I used this fm so many times for my reqt.
    If usefull please reward .
    I think your problem will be solved with this fm.
    Please reward if its useful to you.
    Thanks
    Sivaparvathi
    Message was edited by:
            Siva Parvathi

Maybe you are looking for

  • How can I get my data from my touch to a new computer and i-tunes account

    I have authorized the new computer and set up sharing but I cant seam to import my play list from the other computer, and will I lose all my apps if I plug my touch into the new computer. Please help

  • Can we change an Apple ID?

    The wife and I each received an iPod Touch last year. When I signed in I was asked for my email address. When my wife signed in, she was also asked for our email address and gave it. That ended up being the Apple ID for both of us. Then when she trie

  • What does it take to use an iphone 5 in Europe?

    I live in the US and am going to Italy in a few weeks (just for 10 days or so) and I have just purchased an Iphone 5 with a data plan (not interrnational plan). I was told once in Italy it would work if I go under 1. general settings 2. hit roaming o

  • Creating webpage in fireworks CS3. Is text searchable by search engines?

    Hello all, I started using fireworks cs3 to design webpages. I've been using Dreamweaver cs3. I'm new to the whole flash designing. When you put text and images to design your whole layout, is the text searchable by search engines? I noticed that onc

  • BPC 10 MS - FILTER USING PROPERTY

    HELLO, CAN WE USE "PARENTH1" IN SCRIPTLOGIC TO FILTER RECORDS?  WILL BELOW LOGIC WORK? *WHEN ACCOUNT    *IS ACCT1       *WHEN DATASRC.PARENTH1         *IS "PROP1"          *REC(FACTOR=1,ACCOUNT=ACCT2)     *ENDWHEN *ENDWHEN THANKS IN ADVANCE.