Validation for a extension field in the BAPI ( BAPI_ACC_DOCUMENT_CHECK)

Hi,
I am working on an in terface for upload of data in journal ledger(FB50)
Actually i need to validate a field which has been included in transaction FB50 as an enhancement based on customer need .
a function module was created as suggested in note 487722 earlier but now we require to validate that field(transaction type) as i am using this BAPI in an interface for journal ledger posting FB50 for data validation of the file data.
this field has been populated as a part of the extension parameter in the bapi -
(( BAPI_ACC_DOCUMENT_CHECK)
field values for this field have been passed in the business transaction.
but i am not sure where to code the validation for this field .
could anybody suggest if we need to do it in include ZXACCU15 .
if so then how do we populate the values for the return parameter.
i am post ing document using IDOC and need to generate the for the errors generated.
it already shows for all the standard fields of the transaction.
Its a bit urgent,
help wud be appreciated
jy

Hello Jy
The following coding shows how to evaluate the existence of the transaction type in table T856 and how to create the corresponding BAPI message (using function module <b>BALW_BAPIRETURN_GET2</b>):
*& Report  ZUS_SDN_BAPIRETURN_GET2
REPORT  zus_sdn_bapireturn_get2.
START-OF-SELECTION.
  " Call BTE function within BAPI (actually OPEN_FI_PERFORM_RWBAPI01_P
  " calls the z-function module)
**  CALL FUNCTION 'Z_FI_INTERFACE_RWBAPI01'
**    TABLES
**      c_accit           =
**      c_acccr           =
**      c_return          =
**      c_extension       =
**      c_accwt           =
**    changing
**      c_acchd           =
  " Coding within your BTE function module:
  DATA:
    ls_return    TYPE bapiret2.
* transaction type
  READ TABLE it_accit INTO ls_accit
       WITH KEY posnr = ld_posnr.
  CHECK ( sy-subrc EQ 0 ).
  ld_tabix = sy-tabix.
  ls_accit-posnr = ld_posnr.
  ls_accit-rmvct = ls_bapi_extension-field3.
  MODIFY it_accit FROM ls_accit INDEX ld_tabix.
" Validate existence of transaction type
  SELECT SINGLE * FROM  t856 into ls_t856
         WHERE  trtyp  = ls_accit-rmvct.
  if ( syst-subrc ne 0 ).
    " Note: the following IF condition looks apparently strange yet its primary
    "         use is to ensure that the Where-Used-List for message 014(GC)
    "         will find our function module
    if 1 = 2.  MESSAGE e014(gc) WITH ls_accit-rmvct.  endif.
*   Transaction type & is not defined
    clear: ls_return.
    ls_return-message_v1 = ls_accit-rmvct.  " type conversion
    CALL FUNCTION 'BALW_BAPIRETURN_GET2'
      EXPORTING
        type             = 'E'
        cl               = 'GC'
        number           = '814'
        PAR1             = ls_return-message_v1
*       PAR2             = ' '
*       PAR3             = ' '
*       PAR4             = ' '
*       LOG_NO           = ' '
*       LOG_MSG_NO       = ' '
*       PARAMETER        = ' '
*       ROW              = 0      " ld_tabix
*       FIELD            = ' '    " RMVCT
      IMPORTING
        RETURN           = ls_return.
    APPEND ls_return TO c_return.
  ENDIF.
END-OF-SELECTION.
The advantage of using the function module over directly filling the BAPIRET2 message variable is that the function module generated the message text (field BAPIRET2-message = 'Transaction type '<type>' is not defined').
Regards
  Uwe

Similar Messages

  • SAP Cloud For Customer : Add Extension Fields under the Parameter Binding For Mashups

    Hi Experts,
    I have requirements for the mashups, I have created the extension field in cloud for customer "Registered Product" TI screen i want to add that newly created extension fields under the Mashup Parameter Binding List.
    1) Is it possible ? If yes then How it is?
    2) Any Standard process or we go for the SDK to enhance the standard screen port binding?
    For more information refer the below screen.
    Awaiting for your reply or suggestion....
    Many Thanks,
    Mithun

    I have done the below changes on the custom BO.
    Step 1 . In the Event Handler i have change as per the previous reply.
    Step 2. Assign that Event to Import OnFire.
    I am getting this error when open the Account Screen and go to that Embed Tab.
    "Object [object Object] has no method 'getRawValue'".
    Kindly check the above steps are correct or any step missing.
    Many Thanks,
    Mithun

  • REST API XML tags for person extension fields

    We are trying to use REST API to create a person. We are able to update most of the data but am unable to find the right xml tags for Person Extension fields like custom1 etc. Could you please help?

    Hi !
    In the Account WSDL, you have the ListOfAddress object. If you are using it, filling the field "StreetAddress2" should work...
    Max

  • Maintaing a default value for a particular field in the selection screen

    Hi all,
    How to maintain a default value for a particular field in the Selection Screen of a Standard report
    Regards
    Ajay

    >
    ajay babu wrote:
    > Hi all,
    >
    > How to maintain a default value for a particular field in the Selection Screen of a Standard report
    >
    > Regards
    > Ajay
    Create a variant for your standard program and assign this variant to the field 'Start with variant' while creating transaction code for the standard program in the transaction 'SE93'.
    Regards
    Rajesh.

  • Code for reading particular  fields from the file placed in application

    hi,
    code for reading particular  fields from the file placed in application server in to the internal table.

    Hi,
    Use the GUI_UPLOAD FM to upload the File into ur Internal Table.
    DATA : FILE_TABLE TYPE FILE_TABLE OCCURS 0,
             fwa TYPE FILE_TABLE,
             FILENAME TYPE STRING,
             RC TYPE I.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
        WINDOW_TITLE            = 'Open File'
       DEFAULT_EXTENSION       =
       DEFAULT_FILENAME        =
       FILE_FILTER             =
       INITIAL_DIRECTORY       =
       MULTISELECTION          =
       WITH_ENCODING           =
      CHANGING
        FILE_TABLE              = FILE_TABLE
        RC                      = RC
       USER_ACTION             =
       FILE_ENCODING           =
      EXCEPTIONS
        FILE_OPEN_DIALOG_FAILED = 1
        CNTL_ERROR              = 2
        ERROR_NO_GUI            = 3
        NOT_SUPPORTED_BY_GUI    = 4
        others                  = 5
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    READ TABLE FILE_TABLE INDEX 1 into fwa.
    FILENAME = fwa-FILENAME.
        CALL FUNCTION 'GUI_UPLOAD'
             EXPORTING
                  filename                = filename
                  FILETYPE                = 'DAT'
           IMPORTING
                FILELENGTH              =
             TABLES
                  data_tab                = itab
             EXCEPTIONS
                  file_open_error         = 1
                  file_read_error         = 2
                  no_batch                = 3
                  gui_refuse_filetransfer = 4
                  invalid_type            = 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.
    Regards,
    Balakumar.G
    Reward Points if helpful.

  • Automatically displaying the error text for a form field when the validator fails?

    Hi,
    Flex 2 has a very nice feature to display custom text next to
    a form field whose validation failed. But the user has to move the
    mouse over the form field to display the text. Is there a way to
    invoke this feature programmatically?
    What I would like to do is validate form fields on submit and
    - if validation fails for a form field - set focus on that form
    field and automatically display the custom error text in the red
    blurb. Focusing works fine but I cant' get the text to render...
    Markus

    Thanks Bregent.
    Weirdest thing...I just tried a Google search for a solution to this problem and came across another thread on this forum.  By the time I got to the bottom of it I realised one of those taking part was myself from years ago!  Jeesh, been here before or what!
    Changed my recordset to...
    <%
    Dim rsPROP__MMColParam
    rsPROP__MMColParam = "0"
    If (Request.Form("categoryID") <> "") Then
      rsPROP__MMColParam = Request.Form("categoryID")
    End If
    %>
    <%
    Dim rsPROP__MMColParam1
    rsPROP__MMColParam1 = "1"
    If (Request.Form("categoryID") <> "") Then
      rsPROP__MMColParam1 = Request.Form("categoryID")
    End If
    %>
    <%
    Dim rsPROP
    Dim rsPROP_cmd
    Dim rsPROP_numRows
    Set rsPROP_cmd = Server.CreateObject ("ADODB.Command")
    rsPROP_cmd.ActiveConnection = MM_cs_STRING
    rsPROP_cmd.CommandText = "SELECT prodid, product, categoryID FROM dbo.products WHERE ISNULL(?,0) = 0 OR categoryID = ?"
    rsPROP_cmd.Prepared = true
    rsPROP_cmd.Parameters.Append rsPROP_cmd.CreateParameter("param1", 5, 1, -1, rsPROP__MMColParam) ' adDouble
    rsPROP_cmd.Parameters.Append rsPROP_cmd.CreateParameter("param2", 5, 1, -1, rsPROP__MMColParam) ' adDouble
    Set rsPROP = rsPROP_cmd.Execute
    rsPROP_numRows = 0
    %>
    ...and it works fine.
    Appreciate the help. I would have taken your advice and done an If Else on the WHERE clause to acheive the same.
    Thank you.
    NJ

  • How to provide validation for a particular field of screen

    Hi Experts,
    For my project, I have created a screen. In the screen, we have one field. For this field we have provided F4 help. When the user clicks on the F4 list of values is displayed.
    I have to provide following condition for this field.
    User should only select values from this F4 list only. If the user tries to enter any data which is not contained in the list, system should throw message that 'Invalid data. Select valid values".
    Can you please let me know how I can do so?
    The relevant portion of code is
    CASE save_ok_code.
        WHEN 'EXIT'.
         LEAVE PROGRAM.
        WHEN 'BACK'.
          PERFORM exit.
        WHEN 'CANCEL'.
         LEAVE PROGRAM.
        WHEN 'SAVE'.
          CALL FUNCTION 'MESSAGES_INITIALIZE'.
          PERFORM check_batch CHANGING fl_error.
          IF fl_error IS INITIAL.
            PERFORM save.
            IF sy-subrc EQ 0.
              CLEAR gv_deleted.
              PERFORM update_alv_grid_display.
    ***for message display
              CALL FUNCTION 'MESSAGES_SHOW'.
            ENDIF.
          ELSE.
            CALL FUNCTION 'MESSAGE_STORE'
              EXPORTING
                arbgb  = 'ZEX_MYPROJECT'
                msgty  = 'S'
                txtnr  = '053'
                msgv1  = text-008
              EXCEPTIONS
                OTHERS = 3.
            CHECK sy-subrc = 0.
            CALL FUNCTION 'MESSAGES_SHOW'.
          ENDIF.
        WHEN OTHERS.
          CALL METHOD cl_gui_cfw=>dispatch.
    I am totally new for ABAP. So, please help me out.
    Thanks
    Smith

    Hi,
    Try this.
    Create an internal table and populated it with the values present in the F4 help of the field. Then in AT SELECTION-SCREEN event check the value of the field with the values in the internal table and display the appropriate message.
    Sharin.

  • Email and telephone fields in the BAPI change and display in VA13

    Hi All ,
    1, I need to change the email and telephone fields in the BAPI_SALESORDER_CHANGE , but after i give the inputs its not getting updated in VA13.
    2, I am working with FPM screens , in that i have some value in email field in partner details in Va13 , but its not getting displayed in my FPM screen , iam using bapi BAPISDORDER_GETDETAILEDLIST for displaying .
    I have given the link to the partner and address table for change like addr_link and addr_number , still i couldn't change the email values in VA13.
    Please share your ideas!
    Thanks,
    Pradeep.

    Joecui,
    you have to change the standard fm.
    why cant you fill communication infotype with required details so that you dont need to change any code
    Thanks
    Bala Duvvuri

  • JSF Table StyleClass issue for a specific Field inside the Table

    Hi There,
    Am having an issue of dynamically setting the styleClass for a specific field inside a DataTable. Here is how the JSF code is ..
    <h:column>
    <h:panelGrid id="column4" columns="1" cellpadding="0" cellspacing="0">
    <h:inputText id="numberOfApps" value="#{row.submitNumber}" styleClass="#{row.customStyleClass}" maxlength="6" converter="MyNumberConverter" />
    </h:panelGrid>
    </h:column>
    This Table has a specific column which has a input Text Box where user enter's data. This data will be validated in the bean where in after the validation if its exceeding a limit we should throw an error message and also highlight the field with a specific styleClass.
    I am setting the StyleClass dynamically based on the User Input, so that I can display a highlited Error Field on the screen. Strangely enough, styleclass is getting set as expected for the first submit but doesnt show any styles for further submits. Even the existing style is getting removed from the second submit onwards. I am setting this "customStleClass" dynamic parameter as a Bean Property. Am sure these values are properly set coz to make sure I have put an h:output tag inside that table to display the customStyleClass values and they are getting set as expected but I see blank value for the class="" in the source of the Page.
    Any help would be appreciated.
    Thanks
    Edited by: Lalith on Jan 14, 2008 10:23 AM

    One option is you find the data element of that field GUID.
    Now go to SE11 transaction and in data type put that data element and press where used list. In that select tables.
    This will give you a list of tables where that field is used.
    But again if there are lots of them it will be difficult to find.
    The only option in that case is debug the extractor and find out.

  • Inserting a new extension field in the line item details page

    Hi!
    Is it possible to insert an extension field/collection in the line item details page of the master agreement? I have tried supplying several Field ID found on that page on the DISPLAY AFTER field of the extension, but nothing works - the new field still gets displayed at the header page.
    Thanks in advance.

    Hi,
    Line Item is an independent class. You cant add an extension to Line Item through Master Agreement. This is the reason why the extension you add appears on the header tab of Master Agreement.
    When I go to create an extension definition, I don't find Line Item in the drop down of Extended Class Name. So, my guess would be that we cannot create an extension definition for Line Items.
    Let us know if you, or anybody, has a way to achieve it.
    Thanks
    Devesh

  • How to add a field in the BAPI.

    hi,
    i wanted to add a field zchech in the BAPI (BAPI_INCOMINGINVOICE_CREATE) how to do that.

    Hi Preethi
    BAPI_INCOMINGINVOICE_CREATE is standard SAP BAPI.
    You cannot add new fields to the interface.
    Check whether the interface allows for any customer enhancements.
    Else copy this BAPI into a customer namespace and modify accordingly.
    Reward points if this helps.
    Regards
    Meera

  • ISA order.jsp; message and validation for "Your reference" field

    Hi Everyone,
    I am new to ISA and working on java program to add message to "Your Reference" field in order.jsp page if this field is empty and clicked on "Check Out" button and user need to remain in the same page until user enters information in this field.
    Message is available in .xlf file.
    Please suggest me where to write this code for both message and validation for this field.
    Thanks in advance
    Prasad

    I fixed the requirement
    thanks
    Prasad

  • Validations for gl master uploading by using BAPI

    Hi Gurus,
         We are trying to Upload the GL Masters by using the BAPI Programme.  So can any body tell me the validations for uploading the GL Masters. Its very urgent for me so please any body help me out in this regard.
    Thanks in Advance
    Regards,
    Siva.

    Hello
    Check this out
    regards
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/02/056c40de05587ee10000000a155106/frameset.htm

  • KE5Z : UserExit or SAP Note for adding new fields in the report output

    Hi,
    I want to add 2 new fields in KE5Z (Profit Center: Actual Line Items) report output.
    Order reason(AUGRU), Sales Document Type (AUART) fields.
    Is there any UserExit or SAP Note available for this....
    Thanks in advance,
    fractal

    Hi Fractal,
    See if Note 92864 will help you.
    Summary
    Symptom
    Through a modification, it is possible for you to include additional fields in the profit center line-item reports 'actual' and 'plan' (Release 3.1*).
    Additional key words
    KE5Z, KE5Y, RCOPCA02, RCOPCA08 -
    SUPPORTGUIDE 20010613143936 -
    REPORTWRITER,
    SGRW_OM SGRW_PS SGRW_PC SGRW_SL SGRW_PCA SGRW_EC SGRW_LIS
    Cause and prerequisites
    The fields must be located in table GLPCA (for actual) or GLPCP (for plan).
    For Release 3.0F, you should ensure you have applied Note 62511 first.
    Solution
    To include a field in the actual line item report, proceed as follows:
    Call the ABAP/4 Dictionary (Transaction SE11) and display table GLPCA. You can then find in a line the field name and data element for the field you want to include.
    Return to the initial screen of the ABAP/4 Dictionary. Now change the structure RPCA2. If the structure does not yet contain the field, you select Edit -> Insert field; enter the field name and data element. Do not insert the new field at the beginning of the structure but in the rear half of the structure.
    Then save and activate the structure.
    Now call the ABAP Editor (Transaction SE38). Change the source code of program RCOPCA02. Insert the lines set out in the attachment in FORM routine FIELDCAT_FILL. When you do this, replace SGTXT by the field name of the field. If you normally want the field to be displayed when you the access the report, delete the line   afield-no_out      = 'X'.                "<<<< insert Note 92864 .
    You should note that the place where you insert the lines influences the position of the column in the report list.
    To include a field in the Plan-line-item report, carry out the same procedure except with table GLPCP, structure RPCA8 and program RCOPCA08.
    Note: Pls check if these 2 fields are available in any of the layout versions you have available with the transaction.
    Cheers,
    Vikram
    Pls reward for helpful replies!!

  • How to get the histoical data for newly added field in the cube?

    Hi Experts,
    I have small doubt on remodeling the infocube.
    After adding the characteristic or keyfigure  to a cube by using remodeling concept, how can I get the historical data for that particular field.
    I have searched in SDN also but I didn't get proper information.
    Please excuse me if I posted repeated question.
    helpful answer will be awarded with poitns.
    Thanks & regards,
    Venkat.

    hi
    depending on your customer need you could use the remodelling functionnality but sometimes you have no way to retrieve what you want so another option you should consider is the following:
    Advantages
    that will cost less effort and guarantee the result.
    Drawbacks
    data is redondant for a while
    space (depending on the volume of historical data)
    So here are the steps :
    step 1Adjust your extraction process according to the fields you need to add to populate the cube.
    step 2 Then create a dso next or even a cube, feed the dso with a full load with the enhanced extractor you adjusted with the new fields in step 1 only once in fact this should be one shot.
    step 3 Copy the query to the previous built  multi-provider on top of the new historical data from dso and the running live delta cube. Adjust the queries if necessary.
    optionnal Then if you want to get rid of the dso or new cube for historical data you could empty the actual one push the data from the new data provider and that's all.
    bye
    Boujema

Maybe you are looking for

  • Creating a custom grid in SNP94

    I am looking into creating a custom SNP94 data view. I would like to pull up a selection for multiple materials and then drill-down to the material level. Right now, each key figure is displayed for each material and also a total for each material so

  • Cannot make international call

    Hi, I am having problem to make international call. Below is the config. 022247: *Nov 25 02:08:27.598: %SYS-5-CONFIG_I: Configured from console by admin on vty0 (10.53.5.38)sh run Building configuration... Current configuration : 22590 bytes ! Last c

  • DSM service is not deployed in managed system

    Hi pros, in our system landscape, we installed DSM&BRFplus instance and multiple SAP ECC systems. The purpose is to use DSM to deploy BRFplus services to managed systems. However, When deploying BFFplus functionsto a managed system via DSM. Although

  • SQL-Parameters in BC4J?

    Hi For performance and security reasons it is usually better to use SQL-Parameters (like :1) in SQL-Queries instead of building the SQL-String directly. I'd like to adopt this best practice but stumbled over a problem: BC4J adds Parameters when apply

  • IOS app development

    Hi, I'm working on my first iOS game and should be ready within one week or so. However, reading the latest Adobe AIR SDK release I see that [iPhone 6 Plus] Wrong screen size and dpi is returned through the runtime APIs. My entire app is based on var