Application Development 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: 

question on interface for FB50

Former Member
0 Kudos

I am new to the ABAP world and a little confused on the interfacing of FB50. we currently have a ABAP process that reads a text file and submits the G/L data using FB01 and RFBIBL00. We would like to start using FB50 and I am reading that this is a enjoySAP transaction that does support batch input. I am also reading about interfaces to FB50 that use the bapi BAPI_ACC_DOCUMENT_POST and/or BAPI_ACC_GL_POSTING_POST. Can I write a ABAP to read the text file and use one of the BAPI's to load data to the FB50 transaction? We would like to separate our loading processes so that we can use FB50, FB60, FB70 and move away from FB01 to load all of our data.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

so what you are saying is that even if I set this up to run in background with the "user" parameter for the submit statement, I will still have this issue.

21 REPLIES 21

Former Member
0 Kudos

What difference is it going to make if you are doing this through an interface anyway?

Enjoy transactions are meant to be for users who are posting them online. If you are only interfacing, then it doesn't matter whether it is FB01 or FB50 as long as the data is stored the same way and accounting entries are made correctly.

You can use the BAPI, but then you will write all the code yourself to format the file data into the way BAPI expects and also you have to write code to take care of error handling. What should you do when an error occurs? Where will store the record that caused the error? These are just a couple of things that you may have to do yourself, if you are calling a BAPI.

Also, read the documentation of the BAPI and see if these transactions are supported.

Srinivas

Former Member
0 Kudos

Well, strictly speaking, the two BAPIS you mention don't create an interface to the transactions. They simply post FI documents. Transactions FB50, 60 and 70 are Enjoy SAP transactions and do not work well in batch input (there are SAP notes to this effect).

You can use the BAPIs to post transactions, but I wouldn't want to guarantee that you can post all types of FI transactions. (Search this forum to see what sorts of problems people have.)

A BAPI should be quicker than a BDC session using FB01, but I wouldn't change something that works without a good reason.

Rob

0 Kudos

Hi,

you do <b>not</b> need FB50,60,70, etc. - besides posting manually.

If you work in batch, fb01 and fb05 (with rfbibl00) endure.

Former Member
0 Kudos

what the problem is that we use this upload process to load gl data, customer data, and vendor data. I am assuming that all of the people in these groups that perform this process have access to FB01 which means that a AP person can do a GL transaction. we would like to start a segregation of duties process and have the the AP people only have access to AP, AR to AR and GL to GL. I was told about these transactions FB50, FB60, and FB70 that I thought that I could use in place of the FB01 transaction. If this is not the case, then we will continue to use FB01 and approach this differently.

Former Member
0 Kudos

andreas wrote

-


you do not need FB50,60,70, etc. - besides posting manually.

If you work in batch, fb01 and fb05 (with rfbibl00) endure.

-


I do not understand what this means. what we are trying to do is segregate the duites within AR,AP, and Gl. correct me if I am wrong but if the user runs the transaction code which ececutes my abap program which executes RFBIBL00 and rsbdcsub using FB01, then the user needs access to FB01 in order for the process to work. so in theory, a person in AP and create a entry for GL. I am not sure if anybody else is having this problem with reguards to SOX and the segregration of duties. I am just trying to figure out if there is way to handle this.

0 Kudos

You have mentioned that this is an interface then why do you need access to the user(s). Generally, the interfaces are scheduled as batch jobs using a BATCH-USER (not a dialog user) with SAP-ALL permission. By doing so you dont have to worrry about user authorizations.

Former Member
0 Kudos

being new to ABAP and SAP world, maybe I am not sure what a interface is. the process that we are using is that the user will input data to excel sheet and saved it as a txt file on thier C drive. the user will sign on SAP r/3 and execute a transaction code which calls a ABAP program to read the data from the c drive and fill in the tables needed for RFBIBL00 and rsbdcsub to run the FB01 transaction. If this is not what an interface is then I am sorry for the confusion. I am told that this will not work unless the user has access to FB01. I already had access to FB01 before I started to work on this program for another issue so I am not sure if this is correct or not.

0 Kudos

So you are allowing the users to upload files directly from their desktops. That is number one security risk. Normally what you do is collect all such files and put them on the application server. Then you can schedule your program in the background with batch user id that has access to this transaction.

Even though users are given FB01 transaction access, you can further restrict them to only certain accounts and company codes. There are ways to control it and achieve the seggregation of duties. I don't think you need to change the program for that.

Srinivas

0 Kudos

Do you know the frequency for this upload-program?

Former Member
0 Kudos

I am not sure of the frequency. I'm thinking it is at monthend when they are processing journals for the month. I was looking at the submit command and there is a option" [USER user] You can use the optional addition USER to specify a user ID user of the type sy-uname, which is used to execute the background task." is this something that I can use for the submission of RFBIBL00 and rsbdcsub? this would be helpful if I could sumit the processes under a different user than the person running the process. I could assign the FB01 access to the user that I set up for USER parameter.

0 Kudos

Yes, give it a shot. Make sure the batch-user has all required authorizations.

0 Kudos

It is not the submit that is the problem here. It is how you are preparing the file that is used by RFBIBL00 to create these sessions. If you want the session to be created in some other name instead of the user who ran it, then all you to do is as below.

BGR00-USNAM = <MYBATCHUSERID>

Former Member
0 Kudos

I have been trying this morning and it is not working. I am using the following code. is this code correct? when I run the process and I look at SM35, I still see the my user id.

c_uname(6) TYPE c

VALUE 'BATCH-FIN'. "user for batch submit

SUBMIT rfbibl00

USER c_uname

WITH ds_name EQ w_file

WITH callmode EQ c_mode

WITH anz_mode EQ p_anz

WITH xinf = 'X'

AND RETURN.

IF sy-subrc = 0.

  • write: / text-007.

FORMAT COLOR COL_TOTAL.

WRITE 'Successfully submitted to RFBIBL00'.

SKIP.

ELSE.

WRITE: / text-014.

ENDIF.

SUBMIT rsbdcsub

USER c_uname

WITH mappe EQ c_session

WITH von EQ sy-datum

WITH bis EQ sy-datum

WITH z_verarb = 'X'

WITH fehler = ' '

WITH logall = 'X'

EXPORTING LIST TO MEMORY AND RETURN.

0 Kudos

I think you have to submit the programs as background jobs. Only then the user-id will be effective.

0 Kudos

Submitting as background job:

<u>From SAP-Help</u>


Scheduling a submitable program as a background task with the number number in a background request name. After scheduling, the background task is completed by function module JOB_CLOSE and released immediately. 

DATA: number TYPE tbtcjob-jobcount, 
      name TYPE tbtcjob-jobname VALUE 'JOB_TEST', 
      print_parameters TYPE pri_params. 

... 

CALL FUNCTION 'JOB_OPEN' 
  EXPORTING 
    jobname          = name 
  IMPORTING 
    jobcount         = number 
  EXCEPTIONS 
    cant_create_job  = 1 
    invalid_job_data = 2 
    jobname_missing  = 3 
    OTHERS           = 4. 
IF sy-subrc = 0. 
  SUBMIT submitable TO SAP-SPOOL 
                    SPOOL PARAMETERS print_parameters 
                    WITHOUT SPOOL DYNPRO 
                    VIA JOB name NUMBER number 
                    AND RETURN. 
  IF sy-subrc = 0. 
    CALL FUNCTION 'JOB_CLOSE' 
      EXPORTING 
        jobcount             = number 
        jobname              = name 
        strtimmed            = 'X' 
      EXCEPTIONS 
        cant_start_immediate = 1 
        invalid_startdate    = 2 
        jobname_missing      = 3 
        job_close_failed     = 4 
        job_nosteps          = 5 
        job_notex            = 6 
        lock_failed          = 7 
        OTHERS               = 8. 
    IF sy-subrc <> 0. 
      ... 
    ENDIF. 
  ENDIF. 
ENDIF. 

Former Member
0 Kudos

I used this code BGR00-USNAM = <MYBATCHUSERID>

and looks like it was successful. When I check the header information in FB03 for the document that I created, the "enter by" contains the <MYBATCHUSERID> and the not the person that submitted the process. We are using the "enter by" as a means to track who entered the document.

I will not be able to use this code but thanks for the info.

If I change my process to submit the jobs in background as mentioned in a previous response and I use the "user" parameter that is available with the submit statement, will I run into the same issue as mentioned above where the "entered by" field will contain the value from user field and not the person you submitted the process?

0 Kudos

Unfortunately that is true. BGR00-USNAM is the user id under which the session is run as well as who created the document.

If you are using it for tracking purposes, then you can pass the person's id into some other text field like BBKPF-BKTXT. You cannot use two different user ids, one for submitting the session and another for the document.

Srinivas

Former Member
0 Kudos

so what you are saying is that even if I set this up to run in background with the "user" parameter for the submit statement, I will still have this issue.

0 Kudos

Yes. The program is going to check BGR00 user for both authorizations as well as use it for the USNAM. If you noticed, the structure BBKPF does not have the field USNAM. That is what made this impossible.

Former Member
0 Kudos

So it looks like I will not be able to accomplish the task of limiting the number of users accessing the FB01 transaction and keeping the auditabiblty of the document by the "enter by" field.

I have one more question and then I think I will have exhausted all my options. Is it possible in my ABAP program, after the submission of the RFBIBL00 and the rsbdcsub processes, to retrieve the header documentation and update the USNAM field in the BGR00 table with the value in the sy-uname field. I know that you can to selectes against tables, but can you do updates?

0 Kudos

No, not this field directly. That is why you should store the actual user name somewhere in another field that is not used(usually text fields).