Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BDC Input for FS00

Former Member
0 Likes
2,346

Hello. I have task to do BDC input for transaction FS00.

I have to make a text file on PC (done) .. and I have in that file two "columns" .. One is Main account and second is Short text. And my task is to make BDC input to change short text which is actually in FS00 . In FS00 there is Main Account (I know that numbers) and Short text which I have to change. So I have to put in FS00 (update, change) Short text based on Main account. Can somebody give me a little tutorial how to do it? ...

Thanks very much.

Hello. I have task to do BDC input for transaction FS00.

I have to make a text file on PC (done) .. and I have in that file two "columns" .. One is Main account and second is Short text. And my task is to make BDC input to change short text which is actually in FS00 . In FS00 there is Main Account (I know that numbers) and Short text which I have to change. So I have to put in FS00 (update, change) Short text based on Main account. Can somebody give me a little tutorial how to do it? ...

Thanks very much.

18 REPLIES 18
Read only

Former Member
0 Likes
2,280

Hi,

Short text is stored in SKAT table based on GL account so through program u can change the text for GL account.

Thanks,

Sree

Read only

0 Likes
2,280

Look. I am applying for a job .. and I simply have to make transaction/programm and in that, I have to - import file from my pc, upload it into internal table (Open Dialog and then Upload).. and from that internal table I have to change short text in FS00 .. And I dont know simply how .. Can u put in some piece of code which can make it please? Thanks very much.

Read only

0 Likes
2,280

Hi Dan.

data: it_skat type standard table of skat,
      wa_skat type skat.


start-of-selection.


*here get all saknr and shorttext from skat table
select * from skat into table it_skat.
* it_uplaod having your pc data.

loop at it_upload into wa_upload.
LOOP AT it_skat into wa_skat where saknr = wa_upload-saknr.
wa_skat-TXT20 = wa_upload-text.
modify skat from wa_skat.
ENDLOOP.

endloop.

Thanks,

Sree

Read only

0 Likes
2,280

Hi,

Use read table statement for it_skat internal table.

Thanks,

Sree

Read only

0 Likes
2,280

Hm .. Its still not working .. I´ve made .. Declarations, then is select, then file_open_dialog, then upload into it_upload by fuction gui_upload and then your loop .. but its still not working 😕 IT_SKAT is unknown is that error

Read only

0 Likes
2,280

Hi Dan,

declare it_skat internal table.

data: it_skat type standard table of skat,
      wa_skat type skat.

Thanks,

Sree

Read only

0 Likes
2,280

Hi Dan,

instead of using loop for it_skat internal table, use read table statement. both will work but performance wise read table is good.

loop at it_upload into wa_upload.

   READ TABLE it_skat INTO wa_skat WITH KEY saknr = wa_upload-saknr.

IF sy-subrc EQ 0.
  wa_skat-txt20 = wa_upload-text.
  MODIFY skat FROM wa_skat.
ENDIF.

endloop.

Thanks,

Sree

Read only

0 Likes
2,280

Hi Sre.

So I have decided that I wont use modify etc.. I will do it by using dynpro .. I dont know how, but I have to  .. so if u have some advice, i will be really glad to read her ..

I want do it like .. FILE_OPEN_DIALOG (open file from pc) -> GUI_UPLOAD .. (to internal table) .. And then I am fu.cked up because I dont know what to do then ..

Read only

0 Likes
2,280

Can You give me recording so that I write the code for you?

Read only

0 Likes
2,280
So I have decided that I wont use modify etc..

That is the approach you should follow always.

There is a standard program for changing G/L info which is RFBISA00 .

Read only

0 Likes
2,280

Sijin Chandran wrote:

So I have decided that I wont use modify etc..

That is the approach you should follow always.

There is a standard program for changing G/L info which is RFBISA00 .

Look below please .. There is my problem

Read only

0 Likes
2,280

Let me get this clear...

You are applying for a job and expect other people here on SCN to do the work for you?

This thread is now locked...

Read only

Former Member
0 Likes
2,280

hi dan,

1) first do recording using shdb

2) make a tab delimited text file having main a/c and short text

3) in the zprogram

     perform upload_file. " this will transfer data from text file to internal table (itab)

    

     loop itab

       perform bdc................commands as per recording.

       ..........................      

     end loop.

do hope you get an idea.

Read only

0 Likes
2,280

Hi Abdul .. My "mentor" said that I have to use dynpro .. Like I said above .. FILE_OPEN_DIALOG, then GUI_UPLOAD into internal table .. and from internal table update skat. But with using batch input to avoid unwanted changes..

Read only

0 Likes
2,280

for gui_upload you can use this subroutine.

form upload_file .

  CALL FUNCTION 'UPLOAD'

   EXPORTING

*     CODEPAGE                      = ' '

     FILENAME                      = 'C:\'

     FILETYPE                      = 'DAT'

*

    TABLES

      data_tab                      = record

   EXCEPTIONS

     CONVERSION_ERROR              = 1

     INVALID_TABLE_WIDTH           = 2

     INVALID_TYPE                  = 3

     NO_BATCH                      = 4

     UNKNOWN_ERROR                 = 5

     GUI_REFUSE_FILETRANSFER       = 6

     OTHERS                        = 7

            .

  IF sy-subrc <> 0.

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

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

  ENDIF.

endform.                    " upload_file

Read only

0 Likes
2,280

Look I will try to do my best with describing my problém to you.

I have table skat - in that is saknr - account and shorttext - thats what I need to edit from file what I will upload.

In the file there is lines. Like 5548848 (tab) 'shorttext'

                                             5156165 (tab) 'shorttext'

etc..

And I need to upload that file into some internal table where I will split it by tab and first number will match number in skat (account number) and second 'shorttext' will replace shorttext in skat where account number from text file is same as in table .. And all that should be done with batch inputs ..

Hopefully u understand me and u can somehow help me, because I am kinda messed up from that .. I´ve been learning SAP for 3 weeks and they give me tasks like that to try hold my job ..

Read only

0 Likes
2,280

Hopefully u will understand me now ..

I have something like..

TABLES: skat ..

somedeclarations ..

then ..

perform bdc open group

perform bdc field (skanr and shorttext)

perfrom that transaction FS00

perform close group ..

OPEN DIALOG

UPLOAD

and now I need from internal table where it is saved and splited by tab put it into skat by batch inputs which will run transcation FS00 and one by one updating records.. hopefully u understand me and u can help me with code somehow.

Read only

0 Likes
2,280

Hi Dan,

use GUI_upload to get file data from pc.

  types: begin of ty_upload,
       saknr type saknr,
       text type TXT20_SKAT,
       end of ty_upload.
DATA: it_upload type standard table of ty_upload,
      wa_upload type ty_upload.

   *get data from file.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    filename                      = 'specify the file path'
   FILETYPE                      = 'ASC'
   HAS_FIELD_SEPARATOR           = ' '
  TABLES
    data_tab                      = it_upload
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   NO_AUTHORITY                  = 6
*   UNKNOWN_ERROR                 = 7
*   BAD_DATA_FORMAT               = 8
*   HEADER_NOT_ALLOWED            = 9
*   SEPARATOR_NOT_ALLOWED         = 10
*   HEADER_TOO_LONG               = 11
*   UNKNOWN_DP_ERROR              = 12
*   ACCESS_DENIED                 = 13
*   DP_OUT_OF_MEMORY              = 14
*   DISK_FULL                     = 15
*   DP_TIMEOUT                    = 16
*   OTHERS                        = 17
          .
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.

Thanks,

Sree