Skip to Content

BDC for ztable

Hi experts,

I want to know is there any possiblity of writing BDC for inseting values in ZTABLE.? IF yes how using which t-code u ll do that and wht are the nessasity be maintained to write bdc for inseting data in ztable.? is there any example for that? Please tell me.

I know the inseting the values in ztable using report but i want to know by using BDC.

<b>uesful answers will be rewarded</b>.

Regards,

sunil kairam.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 07:22 AM

    hi,

    first upload data from excel into internal table. and use modify command to update datbase table

    check this code

    REPORT zmat_no message-id zebg.

    TYPE-POOLS truxs.

    TABLES:zmatnr.

    DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.

    DATA row LIKE alsmex_tabline-row.

    data : g_matnr like mara-matnr.

    data : count type i.

    data : itab_count type i.

    data : gi_final like zmatnr occurs 0 with header line.

    *data : begin of gi_final occurs 0,

    • mat_old like mara-matnr,

    • mat_new like mara-matnr,

    • end of gi_final.

    ***********************Selection Screen*************************

    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

    PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.

    select-options : records for count.

    SELECTION-SCREEN END OF BLOCK b1.

    *******************************************************************

    *********************At Selection Screen*************************

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.

    PERFORM search.

    *******************************************************************

    START-OF-SELECTION.

    perform process.

    form process.

    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

    EXPORTING

    filename = pfname

    i_begin_col = 1

    i_begin_row = 2

    i_end_col = 12

    i_end_row = 65000

    TABLES

    intern = itab

    EXCEPTIONS

    inconsistent_parameters = 1

    upload_ole = 2

    OTHERS = 3.

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    describe table itab lines itab_count.

    row = 1.

    loop at itab.

    if itab-row <> row.

    append gi_final.

    clear gi_final.

    endif.

    case itab-col.

    when '1'.

    CLEAR G_MATNR.

    gi_final-OLD_MATNR = itab-value.

    CONCATENATE 'NEW' gi_final-old_matnr INTO itab-value.

    gi_final-new_MATNR = itab-value.

    endcase.

    row = itab-row.

    append gi_final.

    clear gi_final.

    endloop.

    • CALL FUNCTION 'PROGRESS_INDICATOR'

    • EXPORTING

    • I_TEXT = 'File Has Been Successfully Uploaded from Workstation ' .

    if not gi_final[] is initial.

    if not records-low is initial .

    if not records-high is initial.

    records-high = records-high + 1.

    DESCRIBE TABLE gi_final LINES count.

    IF records-high < count.

    DELETE gi_final FROM records-high TO count.

    ENDIF.

    IF records-low <> 1.

    IF records-low <> 0.

    DELETE gi_final FROM 1 TO records-low.

    ENDIF.

    ENDIF.

    endif.

    endif.

    endif.

    IF NOT GI_FINAL[] IS INITIAL.

    CALL FUNCTION 'PROGRESS_INDICATOR'

    EXPORTING

    I_TEXT = 'Processing zmatnr table'

    I_OUTPUT_IMMEDIATELY = 'X'.

    • if itab_count <> count.

    *

    • message i000 with 'records are not matching'.

    *

    • exit.

    *

    • else.

    modify zmatnr from table gi_final.

    message i000 with 'data base table modified successfully'.

    • endif.

    endif.

    endform.

    &----


    *& Form search

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM search .

    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'

    EXPORTING

    static = 'X'

    CHANGING

    file_name = pfname.

    ENDFORM. " search

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Sunil Kumar kairamkonda

      Hi

      there are @ radiobuttons

      1)Read from File

      2)transfer from recording

      yes it will give some problem

      do one thing

      you will fine one include in that

      <b>include bdcrecx1.</b>

      create a new program include this line in you program thats all

      and write the code based on the screen flow

      don't use that program it will be problematic in the feture

      <b>Rewar di fusefull</b>

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.