Skip to Content
author's profile photo Former Member
Former Member

No data was transferred in parameter ACCOUNTGL

I am trying to post the Data in the SAP via BAPI call but it seems to be failed in the SAP.


BAPI Name:BAPI_ACC_GL_POSTING_POST

Message:No data was transferred in parameter ACCOUNTGL


G/L account:0013113700

Company code:IN01


Please help me on priority to resolve the issue.

Thank you in advance

Thanks and Regards,

Rajkumar J

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jan 08, 2014 at 11:39 AM

    Hi,

    full code :

    report z_fi_bapi_fb50

    no standard page heading

    line-size 80

    line-count 50.

    *-------------------------------- DATA --------------------------------*

    data : begin of itab_data occurs 500,

    hkont(10) type c, " Compte

    kostl(10) type c, " C.Coût

    posid(24) type c, " Element d'OTP

    aufnr(12) type c, " Ordre

    dmbtr(13) type c, " Montant

    text(50) type c, "texte

    end of itab_data.

    data : struct_header type standard table of bapiache08

    with header line ,

    itab_accountgl type standard table of bapiacgl08

    with header line ,

    itab_return type standard table of bapiret2

    with header line ,

    itab_currency type standard table of bapiaccr08

    with header line ,

    itab_extension type standard table of bapiextc

    with header line .

    data : v_obj_type like bapiache02-obj_type,

    v_obj_key like bapiache02-obj_key,

    v_obj_sys like bapiache02-obj_sys,

    v_amount(13).

    data: object like nriv-object value 'RF_BELEG'.

    *-------------------------- SELECTION SCREEN --------------------------*

    selection-screen begin of block b2 with frame title text-002.

    parameters : p_bukrs like bkpf-bukrs

    default '1614',

    p_gjahr like bkpf-gjahr

    default sy-datum(04),

    p_date like sy-datum

    default sy-datum,

    p_waers like bkpf-waers

    default 'EUR',

    p_bktxt like bkpf-bktxt

    obligatory ,

    p_file like ibipparms-path

    obligatory .

    selection-screen end of block b2.

    selection-screen begin of block b1 with frame title text-001.

    parameters : p_blart1 radiobutton group 01, "SB

    p_blart2 radiobutton group 01. "OD

    selection-screen end of block b1.

    *------------------------------- EVENTS -------------------------------*

    at selection-screen on value-request for p_file.

    call function 'F4_FILENAME'

    importing

    file_name = p_file.

    *-------------------------------- MAIN --------------------------------*

    start-of-selection.

    * Read data from the Excel file.

    perform p_read_file.

    * Append data for the BAPI.

    perform p_append_data.

    * Create the line of account document.

    perform p_create.

    end-of-selection.

    *----------------------------------------------------------------------*

    * Form P_READ_FILE. *

    *----------------------------------------------------------------------*

    * Reading the content of the file. *

    * Structure of the file. *

    * Column : *

    * -> General ledger account *

    * -> Cost center *

    * -> WBS element *

    * -> Order number *

    * -> Amount *

    * -> Document header text *

    *----------------------------------------------------------------------*

    form p_read_file.

    data : itab_file like alsmex_tabline occurs 100 with header line ,

    v_flag_row type kcd_ex_row_n ,

    v_count(6) type n .

    * Function to read the Microsoft Excel file.

    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'

    exporting

    filename = p_file

    i_begin_col = '1'

    i_begin_row = '2'

    i_end_col = '06'

    i_end_row = '1000'

    tables

    intern = itab_file

    exceptions

    inconsistent_parameters = 1

    upload_ole = 2

    others = 3.

    if sy-subrc ne space.

    stop.

    endif.

    * Transfer data from ITAB_FILE to ITAB_DATA.

    loop at itab_file.

    if v_flag_row ne itab_file-row.

    append itab_data.

    clear itab_data.

    move itab_file-row to v_flag_row.

    endif.

    case itab_file-col.

    when '0001'.

    move itab_file-value to itab_data-hkont.

    when '0002'.

    move itab_file-value to itab_data-kostl.

    when '0003'.

    move itab_file-value to itab_data-posid.

    when '0004'.

    move itab_file-value to itab_data-aufnr.

    when '0005'.

    condense itab_file-value no-gaps.

    replace ',' with '.' into itab_file-value.

    move itab_file-value to itab_data-dmbtr.

    when '0006'.

    move itab_file-value to itab_data-text.

    endcase.

    endloop.

    * Record the last row.

    append itab_data.

    clear itab_data.

    * Detele the empty row.

    delete itab_data where hkont eq space.

    * Check there is something to do.

    describe table itab_data lines v_count.

    if v_count eq space.

    write : /1 ''.

    stop.

    endif.

    endform. " P_READ_FILE.

    *----------------------------------------------------------------------*

    * Form P_APPEND_DATA. *

    *----------------------------------------------------------------------*

    * Append data for the BAPI. *

    *----------------------------------------------------------------------*

    form p_append_data.

    data : v_logsys type logsys ,

    v_kostl type kostl ,

    v_posid type ps_posid ,

    v_aufnr type aufnr ,

    v_blart type blart ,

    v_count type posnr_acc ,

    v_numkr type nrnr ,

    v_nrlevel type nrlevel ,

    v_belnr type belnr_d .

    * Get the logical system number.

    select single logsys

    into v_logsys

    from t000

    where mandt eq sy-mandt.

    * Get the document type.

    if p_blart1 ne space.

    move 'SB' to v_blart.

    else.

    move 'AB' to v_blart.

    endif.

    * Find the next free number.

    select single numkr

    into v_numkr

    from t003

    where blart eq v_blart.

    select single nrlevel

    into v_nrlevel

    from nriv

    where object eq object

    and subobject eq p_bukrs

    and nrrangenr eq v_numkr

    and toyear eq p_gjahr.

    v_nrlevel = v_nrlevel + 1.

    move v_nrlevel+10(10) to v_belnr.

    * Append the header.

    move :

    * 'BKPFF' to struct_header-obj_type ,

    * v_logsys to struct_header-obj_sys ,

    sy-uname to struct_header-username ,

    p_bukrs to struct_header-comp_code ,

    v_blart to struct_header-doc_type ,

    * v_belnr to struct_header-obj_key+00(10) ,

    * p_bukrs to struct_header-obj_key+10(04) ,

    * p_gjahr to struct_header-obj_key+14(04) ,

    p_date to struct_header-doc_date ,

    p_date to struct_header-pstng_date ,

    p_bktxt to struct_header-header_txt .

    * Append the post.

    loop at itab_data.

    v_count = v_count + 1.

    clear itab_accountgl.

    move : v_count to itab_accountgl-itemno_acc ,

    itab_data-hkont to itab_accountgl-gl_account ,

    '00' to v_kostl+00(02) ,

    itab_data-kostl to v_kostl+02(08) ,

    v_kostl to itab_accountgl-costcenter ,

    itab_data-posid to v_posid ,

    v_posid to itab_accountgl-wbs_element ,

    itab_data-aufnr to v_aufnr ,

    v_aufnr to itab_accountgl-orderid ,

    itab_data-text to itab_accountgl-item_text .

    if itab_accountgl-costcenter eq '00'.

    clear itab_accountgl-costcenter.

    endif.

    append itab_accountgl.

    * Montant du poste

    move : v_count to itab_currency-itemno_acc,

    p_waers to itab_currency-currency ,

    itab_data-dmbtr to v_amount ,

    v_amount to itab_currency-amt_doccur .

    append itab_currency.

    endloop.

    endform. " P_APPEND_DATA.

    *----------------------------------------------------------------------*

    * Form P_CREATE. *

    *----------------------------------------------------------------------*

    * Create of G/L account document. *

    *----------------------------------------------------------------------*

    form p_create.

    data : v_type like itab_return-type ,

    v_nrlevel like nriv-nrlevel .

    * Call the BAPI function

    call function 'BAPI_ACC_GL_POSTING_POST'

    exporting

    documentheader = struct_header

    importing

    obj_type = v_obj_type

    obj_key = v_obj_key

    obj_sys = v_obj_sys

    tables

    accountgl = itab_accountgl

    currencyamount = itab_currency

    return = itab_return.

    if sy-subrc eq space.

    commit work and wait.

    if sy-subrc ne space.

    clear itab_return.

    move : 'E' to itab_return-type,

    'S&' to itab_return-id,

    '150' to itab_return-number ,

    'ERROR !!'

    to itab_return-message.

    append itab_return.

    delete itab_return

    where number = '605'.

    endif.

    endif.

    * Edit the result of the BAPI.

    loop at itab_return.

    perform p_message_return using itab_return.

    skip 1.

    endloop.

    * It the document is create, edit the number.

    read table itab_return

    with key number = '605'.

    if sy-subrc eq space.

    skip 1.

    write : /1 text-003 ,

    ':' ,

    itab_return-message_v2+0(10).

    set parameter id 'BLN' field itab_return-message_v2+0(10).

    endif.

    endform. " P_CREATE

    *----------------------------------------------------------------------*

    * Form P_MESSAGE_RETURN. *

    *----------------------------------------------------------------------*

    * Edit the return message. *

    *----------------------------------------------------------------------*

    form p_message_return

    using struct_return structure bapiret2.

    * Color depends of the error type.

    case struct_return-type.

    when 'A'.

    format color 6.

    write : /1 'Termination !' ,

    20 'Classe de message :',

    struct_return-id ,

    45 'Numéro :' ,

    struct_return-number ,

    /1 '' ,

    /1 struct_return-message.

    format color off.

    when 'E'.

    format color 6.

    write : /1 'Error ! ' ,

    20 'Classe de message :',

    struct_return-id ,

    45 'Numéro :' ,

    struct_return-number ,

    /1 '' ,

    /1 struct_return-message.

    format color off.

    when 'I'.

    format color 5.

    write : /1 'Information. ' ,

    20 'Classe de message :',

    struct_return-id ,

    45 'Numéro :' ,

    struct_return-number ,

    /1 '' ,

    /1 struct_return-message.

    format color off.

    when 'S'.

    format color 4.

    write : /1 'Status. ' ,

    20 'Classe de message :',

    struct_return-id ,

    45 'Numéro :' ,

    struct_return-number ,

    /1 '' ,

    /1 struct_return-message.

    format color off.

    when 'W'.

    format color 3.

    write : /1 'Warning ! ' ,

    20 'Classe de message :',

    struct_return-id ,

    45 'Numéro :' ,

    struct_return-number ,

    /1 '' ,

    /1 struct_return-message.

    format color off.

    when 'X'.

    format color 6.

    write : /1 'Short dump !!' ,

    20 'Classe de message :',

    struct_return-id ,

    45 'Numéro :' ,

    struct_return-number ,

    /1 '' ,

    /1 struct_return-message.

    format color off.

    endcase.

    endform. " P_MESSAGE_RETURN


    have fun


    Regards

    Fred

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 11:41 AM

    Hi,

    You have to pass the below parameters! more over check the conversion exit for GL account( may be length problem)

    Header Data:

    e_documentheader-username = s

    e_documentheader-header_txt =

    e_documentheader-comp_code =

    e_documentheader-doc_date =

    e_documentheader-pstng_date =

    e_documentheader-fisc_year =

    e_documentheader-fis_period =

    e_documentheader-doc_type =

    e_documentheader-ref_doc_no =

    Item Data:

    ti_accountgl-itemno_ac

    ti_accountgl-gl_accoun

    ti_accountgl-costcente

    APPEND ti_accountgl.

    ti_accountgl-itemno_ac

    ti_accountgl-gl_accoun

    ti_accountgl-costcente

    APPEND ti_accountgl.

    Other wise paste your code

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2014 at 11:47 AM

    hi,

    check your code with this code. pass all required parameters . Lately i worked on this.

    data : it_bapiparex type table of bapiparex,

    wa_bapiparex type bapiparex,

    wa_bapi_acgl type BAPIACGL09,

    it_bapi_acgl TYPE TABLE OF BAPIACGL09,

    wa_bapi_camt TYPE BAPIACCR09,

    it_bapi_camt TYPE TABLE OF BAPIACCR09,

    wa_docheader type BAPIACHE09,

    it_bapiret2 type TABLE OF BAPIRET2.

    ** Populate the Extension table

    * wa_bapiparex-structure = 'POSTING_KEY'.

    * wa_bapiparex-valuepart1 = '0000000001'. " Item number

    * wa_bapiparex-valuepart2 = '40'. " Posting Key

    * APPEND wa_bapiparex TO it_bapiparex.

    * clear wa_bapiparex.

    * wa_bapiparex-structure = 'POSTING_KEY'.

    * wa_bapiparex-valuepart1 = '0000000002'. " Item number

    * wa_bapiparex-valuepart2 = '50'. " Posting Key

    * APPEND wa_bapiparex TO it_bapiparex.

    * clear wa_bapiparex.

    CLEAR : wa_docheader.

    MOVE sy-uname TO wa_docheader-username. "Username"

    MOVE 'KRISHNA' TO wa_docheader-header_txt."Header Text"

    MOVE 'AP01' TO wa_docheader-comp_code. "Company Code"

    MOVE sy-datum TO wa_docheader-doc_date. "Doc Date"

    MOVE sy-datum TO wa_docheader-pstng_date."Posting Date"

    MOVE 'ZD' TO wa_docheader-doc_type. "Doc Type"

    MOVE '1000/03.01.2014' TO wa_docheader-ref_doc_no."Reference"

    MOVE 'RFBU' TO wa_docheader-bus_act.

    MOVE 'BKPFF' TO wa_docheader-obj_type. "Comment for >= ECC5.0

    MOVE '$' TO wa_docheader-obj_key. "Comment for >= ECC5.0

    MOVE sy-mandt TO wa_docheader-obj_sys. "Comment f

    wa_bapi_acgl-ITEMNO_ACC = '0000000001'.

    wa_bapi_acgl-GL_ACCOUNT = '2000009000'.

    *wa_bapi_acgl-DOC_TYPE = 'SA'.

    *wa_bapi_acgl-DOC_TYPE = 'SA'.

    wa_bapi_acgl-COMP_CODE = 'AP01'.

    *wa_bapi_acgl-ACCT_TYPE = 'S'.

    wa_bapi_acgl-DOC_TYPE = 'ZD'.

    wa_bapi_acgl-FUNDS_CTR = '100'.

    wa_bapi_acgl-CMMT_ITEM = '01'.

    append wa_bapi_acgl to it_bapi_acgl.

    clear wa_bapi_acgl.

    wa_bapi_acgl-ITEMNO_ACC = '0000000002'.

    wa_bapi_acgl-GL_ACCOUNT = '1000080000'."'0000100800'.

    *wa_bapi_acgl-DOC_TYPE = 'SA'.

    *wa_bapi_acgl-DOC_TYPE = 'SA'.

    wa_bapi_acgl-COMP_CODE = 'AP01'.

    *wa_bapi_acgl-ACCT_TYPE = 'S'.

    wa_bapi_acgl-DOC_TYPE = 'ZD'.

    wa_bapi_acgl-FUNDS_CTR = '100'.

    wa_bapi_acgl-CMMT_ITEM = '01'.

    append wa_bapi_acgl to it_bapi_acgl.

    clear wa_bapi_acgl.

    wa_bapi_camt-ITEMNO_ACC = '0000000001'.

    wa_bapi_camt-CURRENCY = 'INR'.

    *wa_bapi_camt-CURRENCY_ISO = 'INR'.

    wa_bapi_camt-AMT_DOCCUR = '15000.00'.

    APPEND wa_bapi_camt to it_bapi_camt.

    clear wa_bapi_camt.

    wa_bapi_camt-ITEMNO_ACC = '0000000002'.

    wa_bapi_camt-CURRENCY = 'INR'.

    *wa_bapi_camt-CURRENCY_ISO = 'INR'.

    wa_bapi_camt-AMT_DOCCUR = '-15000.00'.

    APPEND wa_bapi_camt to it_bapi_camt.

    clear wa_bapi_camt.

    CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

    EXPORTING

    documentheader = wa_docheader

    TABLES

    accountgl = it_bapi_acgl

    * accountpayable = it_bapi_acpl

    currencyamount = it_bapi_camt

    return = it_bapiret2.

    * extension2 = it_bapiparex.

    IF sy-subrc is INITIAL.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    * EXPORTING

    * WAIT =

    * IMPORTING

    * RETURN =

    .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 08, 2014 at 12:13 PM

    Please check the table SKB1, whether that GL is assigned to your company code ?

    Cheers,

    Prakash

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.