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

need the format for input file for standard program

Former Member
0 Likes
2,115

hi can any one please give me the format in which the file to be uploaded to program RFBIBL00 ,

must be in for example my excel file to be uploaded has the following columns.

company code

accounting doc

line item

fiscal year

doc type

doc date

.

.

.

.

so is there any program which can create a file in the format to be uploaded taking this excel sheet.

i read the documentation but i am little confused about that.

thank you.

5 REPLIES 5
Read only

naimesh_patel
Active Contributor
0 Likes
1,037

No you need to create your own Z program which can upload the file.

I prefer the structure of the file like.

indicator,,company code,, fiscal year,, doc type,, doc date,,positng date,,header text,,Account,,posting key,, amount,, item text,, assignment number ....
H,,0001,,2007,,SA,,20071121,,20071121,,TEST
D,,,,,,,,,,,,,,100001,,40,,100.21,,THIS IS FIRST ITEM,,12345
D,,,,,,,,,,,,,,100002,,50,,100.21,,THIS IS FIRST ITEM,,12345
H,,0001,,2007,,SA,,20071121,,20071121,,TEST
D,,,,,,,,,,,,,,100001,,40,,100.21,,THIS IS FIRST ITEM,,12345
D,,,,,,,,,,,,,,100001,,50,,100.21,,THIS IS FIRST ITEM,,12345

Then you can read this file and set the format which can be used in RFBIBL00.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,037

hi naimesh,

i am not clear,

as you said, i will write a function module which will pick this file up and then

convert it into a format to be submitted to the RFBIBL00 program,

is ther any specific format for a file to be submitted to this std program.

thank you

Read only

0 Likes
1,037

Yes, this RFBIBL00 can only accept some specific format of file.

The file generated by RFBIBLT0, can be used for RFBIBL00.

You need to create a file in a way RFBIBLT0 is creating. Output file of your program must match the output file of the program RFBIBLT0.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,037

hi naimesh,

we are at the same point again,

do you have a sample of how it looks,

so that i can set my file in that format.

thank you

Read only

0 Likes
1,037

Ok.. I have created one small test program for RFBIBL00.

That program uses this file format:

indicator company code fiscal year doc type doc date positng date header text Account posting key amount item text assignment number ....

H	0001	2007	SA	11/21/2007	11/21/2007	Test from RFBIBL00					
D							106210	40	123.3	Line 1	
D							106210	50	123.3	Line 2	
H	0001	2007	SA	11/21/2007	11/21/2007	Test from RFBIBL00					
D							106210	40	123.3	Line 1	
D							106210	50	123.3	Line 2	

Copy this data into one notepad and save it as .txt file. you need to provide this path to the test program.

The source code of the program (Currently it is only test version):

*&---------------------------------------------------------------------*
*& Report  ZTEST_NP_RFBIBL00
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZTEST_NP_RFBIBL00.

TABLES:  BGR00,                        " Batch-Input Mappendaten
         BBKPF,                        " Batch-Input Tcode + Belegkopf
         BBSEG,                        " Batch-Input Belegsegment
         BBTAX,                        " Batch-Input Belegsteuern
         BSELK,                        " Batch-Input Selektionskopf
         BSELP.                        " Batch-Input Sel.positionen

DATA: BEGIN OF IT_FILE OCCURS 0,
      IND,
      BUKRS(4),
      GJAHR(4),
      BLART(2),
      BLDAT(10),
      BUDAT(10),
      BKTXT(25),
      HKONT(10),
      BSCHL(2),
      DMBTR(17),
      SGTXT(30),
      ZUONR(17),
      END   OF IT_FILE.

DATA:    C_NODATA(1)  TYPE C VALUE '/'.   " NODATA

SELECTION-SCREEN: BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-T01.
PARAMETERS:       P_LFILE TYPE CHAR70 OBLIGATORY,
                  DS_NAME TYPE CHAR70 OBLIGATORY LOWER CASE,  "< Server file
                  GR_NAME(12) TYPE C DEFAULT 'FI_TEST'.

SELECTION-SCREEN: END   OF BLOCK BLK1.

START-OF-SELECTION.
  PERFORM UPLOAD_DATA.

  OPEN DATASET DS_NAME FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
  PERFORM INIT_STRUKTUREN_ERZEUGEN(RFBIBLI0) USING C_NODATA.

  PERFORM SET_DATA.
  CLOSE DATASET DS_NAME.

  PERFORM SUBMIT_RFBIBL00.

*&---------------------------------------------------------------------*
*&      Form  upload_data
*&---------------------------------------------------------------------*
FORM UPLOAD_DATA .

  DATA: L_FILE TYPE RLGRAP-FILENAME.
  L_FILE = P_LFILE.

  CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      FILENAME                      = L_FILE
      FILETYPE                      = 'DAT'
*    HAS_FIELD_SEPARATOR           = ','
    TABLES
      DATA_TAB                      = IT_FILE
            .
  IF SY-SUBRC <> 0.
    MESSAGE S398(00) WITH 'Error while uploading'.
    LEAVE LIST-PROCESSING.
  ENDIF.

ENDFORM.                    " upload_data


*&---------------------------------------------------------------------*
*&      Form  set_data
*&---------------------------------------------------------------------*
FORM SET_DATA .

  PERFORM SET_BGR00.
  LOOP AT IT_FILE.
    CASE IT_FILE-IND.
      WHEN 'H'.
        PERFORM SET_BBKPF.
      WHEN 'D'.
        PERFORM SET_BBSEG.
    ENDCASE.
  ENDLOOP.

ENDFORM.                    " set_data
*&---------------------------------------------------------------------*
*&      Form  set_BGR00
*&---------------------------------------------------------------------*
FORM SET_BGR00 .

  PERFORM INIT_BGR00(RFBIBLI0) USING BGR00.
  BGR00-MANDT = SY-MANDT.
  BGR00-GROUP = GR_NAME.
  BGR00-USNAM  = SY-UNAME.
  BGR00-NODATA = C_NODATA.
  TRANSFER BGR00 TO DS_NAME.

ENDFORM.                                                    " set_BGR00
*&---------------------------------------------------------------------*
*&      Form  set_bbkpf
*&---------------------------------------------------------------------*
FORM SET_BBKPF .

  PERFORM INIT_BBKPF(RFBIBLI0) USING BBKPF.
  BBKPF-TCODE     = 'FB01'.
  BBKPF-BLART     = IT_FILE-BLART.
  BBKPF-BUKRS     = IT_FILE-BUKRS.
  BBKPF-BLDAT+0(6) = IT_FILE-BLDAT+0(6).
  BBKPF-BLDAT+6(2) = IT_FILE-BLDAT+8(2).
  BBKPF-BUDAT+0(6) = IT_FILE-BUDAT+0(6).
  BBKPF-BUDAT+6(2) = IT_FILE-BUDAT+8(2).
  TRANSFER BBKPF TO DS_NAME.

ENDFORM.                    " set_bbkpf
*&---------------------------------------------------------------------*
*&      Form  set_bbseg
*&---------------------------------------------------------------------*
FORM SET_BBSEG .

  PERFORM INIT_BBSEG(RFBIBLI0) USING BBSEG.
  BBSEG-NEWKO = IT_FILE-HKONT.
  BBSEG-NEWBS = IT_FILE-BSCHL.
  BBSEG-WRBTR = IT_FILE-DMBTR.
  BBSEG-SGTXT = IT_FILE-SGTXT.
  TRANSFER BBSEG TO DS_NAME.

ENDFORM.                    " set_bbseg
*&---------------------------------------------------------------------*
*&      Form  submit_rfbibl00
*&---------------------------------------------------------------------*
FORM SUBMIT_RFBIBL00 .

  SUBMIT RFBIBL00 WITH DS_NAME = DS_NAME
                  WITH CALLMODE = 'B'
                  WITH XLOG = 'X'
                  AND RETURN.

ENDFORM.                    " submit_rfbibl00

If you have any problem getting file, send me an e-mail (my id is on my business card) I will send you the file as a attachment

Regards,

Naimesh Patel