GRAC_SPM_LOG_SYNC_UPDATE Job Performance
We are about to Go live with our Super user Auto Provisioning and Firefighter Log reporting in GRC 10.
Right now GRAC_SPM_LOG_SYNC_UPDATE Job runs for more than day in our ECC/PRD system and we have 11 App Servers in the system.
Currently our RTA Plugins are:
ECC/PRD system is GRCPINW V1000_700 0009 SAPK-10309INGRCPINW
SAP GRC NW Plug-in .
In BI we are on GRCPINW V1000_731 0002 SAPK-
10502INGRCPINW SAP GRC NW Plug-in
In APO we are on GRCPINW V1000_700 0005 SAPK-10305INGRCPINW
SAP GRC NW Plug-in
In SRM we are on GRCPINW V1000_700 0005 SAPK-10305INGRCPINW
SAP GRC NW Plug-in
Our GRC Support pack is 17
Why the job is taking so much time to run in ECC/PRD.
In BI/APO/SRM the job runs every hour successfully.
We are running the GRAC_SPM_LOG_SYNC_UPDATE job every hour in ECC also but only one job runs for more than a day and all other jobs fail.
Hi Plaban,
Thanks for your reply.
We run the Jobs every hour and the time difference between the jobs is 15 mins the jobs in SRM/APP/BI run for just few seconds only because we have only one app server in each system where as in PRD we have 11 App servers.
I have opened the OSS message waiting for there reply.
May be I am thinking we need to upgrade our RTA in ECC Right now we are at 5 the latest one is 19.
Regards,
Venkat
Similar Messages
-
Batch Job Performance Issue in BW
Hi All
I would like to if there are any performance tuning methods for batch jobs in BW. Few jobs are taking much longer time and i need to figure out a method to tune them.
Thanks in advance for your help
Regards
JPHi JP,
Dinesh is right, you need to consider the tuning for specific scenarios. If some of the jobs are taking longtime just access at what point they are taking time by going to the JobLog in source sytem/BW, and try to take up the optimization of the resources used inthe source system. For Eg: It can be even in the Extractor. I had come across such issue with long loading times for few ledgers in FISL. But could encounter that by spitting load with small number of records to BW with an ABAP program incorporated inthe InfoPack with the selections for the Reconcilation key.
In this way, you need to first identify the delay for the jobs. Then you can plan the things accordingly..
Hope this will help you..
Regards,
Madhu -
Batch Job Performance Issue.
Hi Experts,
I am facing a performance issue in a background job, on a selection screen it contains month start date, end date and also effective date as 01/01/2008.
Client executing this report once in every month. Since the effective date is constant, the database contains large volume of data i.e. more than 3 lakh records Presently. Finally the job gets cancelled.
Could you please suggest what should be done in this scenario? Is there any concept like splitting the records as batches like multiples of 20 thousands.
Thanks and Regards,
Stanlyhi
As you said you can split the records as packages. ( as teh issue is related to low memory of internal table )
select ....package size...
*-- program logic
endslect.
regards,
Naveen -
Siebel EDQ batch job performance
Hi there,
We are using Siebel Public Sector 8.2.2.4 with EDQ 11.1.1.7 version to clean up existing contact records and also set up real-time deduplication for ongoing contacts. We didn't tune any parameters both from Siebel and EDQ side till now.
We observed that the process is taking 45-50 minutes to process 6000 records. We noticed that the process is taking more time while inserting the records from Siebel to staging database. The EDQ contact deduplication is just fine and it it taking around 8-14 minutes based on number of records to process.
Is there a way we can tune anything from Siebel side to improve the performance while loading the data into staging database. May be Batch max number of records or number of DB connections or sessions etc to improve the performance?
Also, can you suggest if we could run the jobs from Siebel ( by splitting into multiple batches) in parallel? I am not sure if this is an option as the parallel tasks uses the same sharing database and it might have an conflict.
Please suggest.
Regards
Siva SontiHi,
So to understand correctly, these are true batch jobs with the data being handed over using the staging tables.
It seems like the problem here - which we have seen before - is the performance of the candidate selection query in Siebel for incremental batch jobs - the piece where the candidate records for the selected batch of records to match are selected. How long does a Full Batch job take to run (as this does not need to make this query)?
Also, is this Siebel CRM or UCM? If UCM, you can use the 'UCM Batch' workflow which although it calls EDQ in real-time can be scaled using as many tasks in Siebel as the system can handle; customers have been able to load up to 9000 records/minute with this method.
The nature of the shared staging database means it only supports a single job for data from a single business component (e.g. Contact) at any one time, as you suspected.
If you are really 'loading records' into Siebel, you may be better of loading them using the EIM interface - perhaps with EDQ pre-matching the data and directly writing to the EIM tables.
Regards,
Mike -
Hi guys,
Our requirement is such that we have to process 3000 to 5000 back orders on daily basis.
If we use the standard transaction V_RA, it takes min 45 min to 1 hour to process all the back orders.So standard program is not meeting our requirement
Is there any way we can process 5000 orders in 3 to 5 min via batch program.
We will create Z program by copying V_RA and can do required modifications
Please advice
Regards
ManoHi ,
Discuss with your abaper to schedule the job more than work process ( distribute the work on multiple work process)
then its possible to get finished whatever time you want.
Thanks
siva -
SQL Loader and Insert Into Performance Difference
Hello All,
Im in a situation to measure performance difference between SQL Loader and Insert into. Say there 10000 records in a flat file and I want to load it into a staging table.
I know that if I use PL/SQL UTL_FILE to do this job performance will degrade(dont ask me why im going for UTL_FILE instead of SQL Loader). But I dont know how much. Can anybody tell me the performance difference in % (like 20% will decrease) in case of 10000 records.
Thanks,
Kannan.Kannan B wrote:
Do not confuse the topic, as I told im not going to use External tables. This post is to speak the performance difference between SQL Loader and Simple Insert Statement.I don't think people are confusing the topic.
External tables are a superior means of reading a file as it doesn't require any command line calls or external control files to be set up. All that is needed is a single external table definition created in a similar way to creating any other table (just with the additional external table information obviously). It also eliminates the need to have a 'staging' table on the database to load the data into as the data can just be queried as needed directly from the file, and if the file changes, so does the data seen through the external table automatically without the need to re-run any SQL*Loader process again.
Who told you not to use External Tables? Do they know what they are talking about? Can they give a valid reason why external tables are not to be used?
IMO, if you're considering SQL*Loader, you should be considering External tables as a better alternative. -
Is Services in SAP and Customer Jobs in Quick Books same?
Hi All,
Services done for a customer by a sales rep is stored in Service modules in SAP. In QuickBooks Customer Jobs field is there for a Sales person to calculate is commisssion based on the job performed by her/him to the customer.
My Question is whether the both or same.
Please reply soon
I always welcome ur suggestions
Thanks in Advance
JanakiramanHi Janakiraman,
Unfortunately I do not know quick books. All service call data is stored in the database, so you can do your own report calculations on commissions for the sales people. Invoices can also be booked against a service call and commission by sales person can be calculated on the invoices.
Hope it helps,
Adele -
How to get a graphical display of spool request after a batch job?
Hi all,
I have scheduled a bunch of batch jobs. When I run sm37 to look at the finished jobs, I can see that there is a "papirus like ikon" in the second column, Ln, (the one on the right from the job names) for some of the jobs, but not for the most of them.
Now when I, in sm37, mark this job for which I have an "papirus like ikon", press a "Spool" icon on top of the screen, then mark one step and press the "google icon" I get an output of what job performed in that step. That output usually gives a quite good information of what the program did (e.g. Nr of lines deleted, OP released).
Now my question is how do I get that spol output for the rest of the jobs as well?
Thanks and Kind Regards,
ArminHi Thomas,
As you said, the OTF is stored as is in the spool file, and you can read it using the C calls, or use RSPO_RETURN_SPOOLJOB function module for example.
Note that using SP01, you can send a spool via a menu entry, which corresponds to function module RSPO_SPOOLJOB_TO_OFFICE.
Best regards
Sandra -
How to trigger a background job from BADI method.
hi friends,
i need to trigger a background job from the badi method CHANGE_AT_SAVE for the BADI BOM_UPDATE.
for this i think i need to create an event which i should give with parameters during job creation.
can you pls help me solve this issue.
thank u all.Hi Saravanan,
Here is an example of what you have to do.
Regards,
Eric
Reward any helpful sugestion.
*& Form generar_job
FORM generar_job .
Generar Variante
PERFORM generar_variante.
w_fecha = sy-datum + 3.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = w_fecha
IMPORTING
day = w_weekday.
Si la fecha cae en sabado o domingo se debe continuar el lunes.
CASE w_weekday.
when '1'.
ADD 2 TO w_fecha.
WHEN '6'.
ADD 2 TO w_fecha.
WHEN '7'.
ADD 1 TO w_fecha.
ENDCASE.
w_jobname = 'ZQM_CIERRE_LOTE_INSPECCION'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobgroup = 'QUEUE'
jobname = w_jobname
IMPORTING
jobcount = w_jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc EQ 0.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobcount = w_jobcount
jobname = w_jobname
report = 'ZQM_CIERRE_LOTE_INSPECCION'
variant = w_var
IMPORTING
step_number = w_stepnum
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10.
IF sy-subrc EQ 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_jobcount
jobname = w_jobname
sdlstrtdt = w_fecha
sdlstrttm = w_hora
IMPORTING
job_was_released = w_rel
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 EQ 0.
IF w_rel EQ 'X'.
WRITE:/ w_jobname, 'FUE LIBERADO. VER SM37.'.
Guardamos los destinatarios
PERFORM destinatarios_job.
Guardamos la información a utilizar al ejecutar el job
PERFORM guardar_datos_job.
ELSE.
WRITE:/ w_jobname, 'NO FUE LIBERADO'.
ENDIF.
ELSE.
WRITE:/ w_jobname, 'NO FUE CERRADO'.
ENDIF.
ELSE.
WRITE:/ w_jobname, 'NO FUE ENVIADO'.
ENDIF.
ELSE.
WRITE:/ w_jobname, 'NO FUE CREADO'.
ENDIF.
ENDFORM. " generar_job -
We are facing some job performance issue during oracle 10g upgrade and datacenter migration. Can some one help in this regard?
The Details are as follows.
Before Migration
OS of Existing Server : HP-Unix
Oracle DB version : Oracle9i Enterprise Edition Release 9.2.0.5.0
Job code using : Pro*c
Execution Time of Job : 1 Hrs.
After Migration to datacenter and Oracle 10g upgrade.
Please note that in this configuration, jobs and application is running on same server but connecting database on oracle 10g new datacenter server)
OS of Server after migration (Application server) : HP-Unix
OS of Server after migration (Database VADE Server) : Linux
Oracle DB version : Oracle Database 10g Release 10.2.0.4.0
Job code using : Pro*c
Execution Time of Job : 6 Hrs.
Please let me know performance improvement is required on (inputs / suggestions are required ) OS level and on network side
thanks,
TippuPl also see these MOS Docs
745216.1 - Master Note: Query Performance Degradation - Upgrade Related - Recommended Actions
466350.1 - Recording Explain Plans before an upgrade to 10g or 11g
562899.1 - TESTING SQL PERFORMANCE IMPACT OF AN ORACLE 9i TO ORACLE DATABASE 10g RELEASE 2 UPGRADE WITH SQL PERFORMANCE ANALYZER
HTH
Srini -
Fixing standard transport import job
Hi,
We have R/3, APO and B/W.
In R/3 and APO, when we move batches of transports from QA to Staging(STMS_QA) everything is fine.
But in the past we sometime experimented problem when doing the same in B/W. Somebody once told us that when you move many transports together, the standard import job perform first step for all transports then 2nd step for all of them, etc......
This is no problem for R/3 and APO, but we were told that does not always work in B/W. Because of that, we change our process for B/W. We run STMS_QA and the import job, one transport after the other. Since the import job is scheduled every 15 minutes, if we have 8 transports to move, it will take 2 hours to perform them all.
I was ask to write a job that would do this automatically, then replacing the standard import job.
Then I'm saying to myself: we are not the only ones to move transports in batch in the world? Do everybody reinvent the wheel each time like I am about to do?
Can somebody give me some thought over this? Any suggestion?
Thank you!Discussion successfully moved from SAP Transportation Management (SAP TM) to SAP NetWeaver Administrator where it belongs.
Your recent question posted in SCN SAP Transportation Management community is in the wrong place. SAP TM is devoted to the SAP application which manages the physical movement of goods using trucks, trains, planes, and ships. What you posted regarding software changes from one system to another (Dev to QA, for example) should be in the Netweaver Administrator community. Please use the correct community in the future.
Regards, Mike (Moderator) -
Schedule Jobs. Is it possible ?
How could we schedule a , for example , procedure to run ?
Is it possible ?
I realized a service (disabled) called OracleJobSchedulerXE on my Win box. Does it have something to do with this subject ?
Thanks in advance.I believe it's possible. The service you mention is to run external jobs. Here's doc on it:
4.4 Configuring External Job Support for the Scheduler on Windows
This release includes a new database scheduler to provide enterprise scheduling functionality. External jobs performed by the user are started using the OracleJobScheduler service. This service is disabled by default. In order to use the external jobs functionality, the administrator must set the username and password for the user account under which this service must run and enable the service.
Restricting execution of external jobs to a low-privileged user prevents unauthorized database users from gaining operating system level privileges, but it also places restrictions on the kinds of jobs that can be run. Jobs requiring a higher level of operating system privileges cannot be run by this mechanism.
Thanks,
LewisC
http://blogs.ittoolbox.com/oracle/guide/ -
Is performance apparaisal effective?
We know that performance apparaisal is the method by which the job performance of an employee is evaluated (generally in terms of quality, quantity, cost, and time) typically by the corresponding manager or supervisor. It is the process of obtaining, analyzing, and recording information about the relative worth of an employee to the organization. Performance appraisal is an analysis of an employee's recent successes and failures, personal strengths and weaknesses, and suitability for promotion or further training.
Do you think performance apparaisal is really effective in organizations? How to use the most effectivelly?It is very effective (of course, if done correctly). It takes out the "subjective" part of the "old way of doing things", and puts in place true measures/metrics for evaluating employees.
It is suppose to alleviate the old example of.....two people are up for the same job/promotion.....person A has great skills and background....person B has fewer skills (even lacking some key ones) but is good friends with the boss.....person B gets this job. SImilarly....and much like the previous example.....person A is up for a review....their boss "thinks" they have done well all year and remembers some projects they helped on and things they talked about in emails/status reports....person A gets a pay raise.......when in fact they did very little to deserve it.
Also, it allows for 360 appraisals...yes, a manager/boss has a much more clear way to evaluate their direct reports performance....but also, their direct reports can evaluate them as well.
It's just very nice all around. Not sure what your doubts in it are are why you think it is not effective. You pretty much laid out the text book definition of it but then don't seem to understand what you just wrote. -
The columns are missed in Backgroup job in report program
Hi experts,
I have a report program and I display it by WRITE statement. The total length of the report is about 550, and I set the line-size to 600. When I run it by backgroup job, it can not display the row completedly, the last 10 columns are missed. Do any one know what happpen and how I fixed it? Thanks in advance.
Best Regards
JoeHi Kiran,
I had completed the program and now I am showing you my solution in brief.
I hvae two programs to meet the solution. First is ZSDR0087 and next is ZSDR0087_RAW_PROGRAM. The former program is just for the purpose of calliing latter program, and latter program is for handling the program logic. The transaction code link to ZSDR0087 They are using a same selection screen.
Below is the cods of selection screen
SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE text-001.
PARAMETERS: p_hbad TYPE /bluesky/cshbad-hbad OBLIGATORY MEMORY ID hba."#EC EXISTS
SELECT-OPTIONS: s_airli FOR /bluesky/mdairlz-airline MODIF ID m4,
s_altp FOR /bluesky/mdairlz-altp MODIF ID m4,
s_kunnr FOR knvv-kunnr MODIF ID m4,
s_prsdt FOR /bluesky/fecpost-prsdt MODIF ID m4,
* s_atdat FOR /bluesky/fearde-atdat OBLIGATORY,
s_actyp FOR /bluesky/mdacrt-actyp MODIF ID m4,
s_mtmcat FOR /bluesky/mdacrt-mtomcat MODIF ID m4,
s_regid FOR /bluesky/mdreg-regid MODIF ID m4,
s_fenum FOR /bluesky/fehdr-fenum MODIF ID m4.
PARAMETERS: p_en_ex TYPE c AS LISTBOX VISIBLE LENGTH 10 MODIF ID m4.
SELECTION-SCREEN END OF BLOCK sel1.
SELECTION-SCREEN BEGIN OF BLOCK run WITH FRAME TITLE text-003.
PARAMETERS: p_imm RADIOBUTTON GROUP grp1 DEFAULT 'X' USER-COMMAND comm."Run the program immdiately and show report at frontend
PARAMETERS: p_batch RADIOBUTTON GROUP grp1, "Run in backgroup job, the result will be saved at application server as .txt file
p_file TYPE g_type_file LOWER CASE MODIF ID m1. ".txt File name which will be saved in application server
PARAMETERS: p_ser RADIOBUTTON GROUP grp1. "Read the data from .txt file in application server
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(14) text-004 FOR FIELD p_txt MODIF ID m2.
PARAMETERS: p_txt TYPE g_type_file LOWER CASE MODIF ID m2."Source .txt file in application server
SELECTION-SCREEN COMMENT 50(14) text-005 FOR FIELD p_del MODIF ID m2.
PARAMETERS: p_del AS CHECKBOX MODIF ID m2. "The .txt file will be deleted once the report is generated
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK run.
SELECTION-SCREEN BEGIN OF BLOCK sel2 WITH FRAME TITLE text-002.
PARAMETERS: p_xls AS CHECKBOX DEFAULT '' MODIF ID m3."Generate the excel file in frontend
SELECTION-SCREEN END OF BLOCK sel2.
Main Code in ZSDR0083
REPORT zsdr0087 MESSAGE-ID zbluesky_program LINE-SIZE 530 NO STANDARD PAGE HEADING."#EC *
INCLUDE zsdr0087_top.
INCLUDE zsdr0087_common_blk.
INCLUDE zsdr0087_frm.
START-OF-SELECTION.
PERFORM handle_report.
FORM handle_report .
IF p_imm = 'X' OR p_ser = 'X'.
PERFORM run_program_without_batch.
ELSEIF p_batch = 'X'.
PERFORM submit_to_batch.
ENDIF.
ENDFORM. " handle_report
FORM run_program_without_batch .
DATA: lv_answer TYPE c.
IF p_ser = 'X' AND p_txt IS INITIAL.
MESSAGE s029.
EXIT.
ENDIF.
IF p_ser = 'X' AND p_del = 'X' AND p_xls = ''.
PERFORM popup_to_confirm USING 'Delete file in server' "titlebar
'The file in server will be deleted, are you going to save the data in Excel file?' "question
'SAVE IN EXCEL'"the text in first button
'ICON_XLS' "the icon for first button
'Not Save'
'ICON_WARNING'"the icon for second button
'1'"default button
'X'"display cancel button
CHANGING lv_answer.
CASE lv_answer.
WHEN '1'.
p_xls = 'X'.
WHEN '2'.
p_xls = ''.
WHEN 'A'.
MESSAGE s032.
EXIT.
ENDCASE.
ENDIF.
SUBMIT zsdr0087_raw_program WITH p_hbad = p_hbad
WITH s_airli IN s_airli
WITH s_altp IN s_altp
WITH s_kunnr IN s_kunnr
WITH s_prsdt IN s_prsdt
WITH s_actyp IN s_actyp
WITH s_mtmcat IN s_mtmcat
WITH s_regid IN s_regid
WITH p_en_ex = p_en_ex
WITH p_imm = p_imm
WITH p_batch = p_batch
WITH p_file = p_file
WITH p_ser = p_ser
WITH p_txt = p_txt
WITH p_del = p_del
WITH p_xls = p_xls
AND RETURN.
ENDFORM. " run_program_without_batch
FORM submit_to_batch .
DATA: lv_job_name TYPE tbtcjob-jobname,
lv_job_number TYPE tbtcjob-jobcount.
lv_job_name = p_file.
TRANSLATE lv_job_name TO UPPER CASE.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = lv_job_name
IMPORTING
jobcount = lv_job_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e022.
ENDIF.
SUBMIT zsdr0087_raw_program WITH p_hbad = p_hbad
WITH s_airli IN s_airli
WITH s_altp IN s_altp
WITH s_kunnr IN s_kunnr
WITH s_prsdt IN s_prsdt
WITH s_actyp IN s_actyp
WITH s_mtmcat IN s_mtmcat
WITH s_regid IN s_regid
WITH p_en_ex = p_en_ex
WITH p_imm = p_imm
WITH p_batch = p_batch
WITH p_file = p_file
WITH p_ser = p_ser
WITH p_txt = p_txt
WITH p_xls = p_xls
VIA JOB lv_job_name NUMBER lv_job_number
AND RETURN.
IF sy-subrc NE 0.
MESSAGE e023 WITH 'zsdr0087_raw_program'..
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lv_job_number
jobname = lv_job_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 NE 0.
MESSAGE e025.
ELSE.
MESSAGE s026.
ENDIF.
ENDFORM. " submit_to_batch
:OK, Below is main code in program ZSDR0087_RAW_PROGRAM
REPORT zsdr0087 MESSAGE-ID zbluesky_program LINE-SIZE 530 NO STANDARD PAGE HEADING."#EC *
INCLUDE zsdr0087_top.
INCLUDE zsdr0087_common_blk.
INCLUDE zsdr0087_frm.
START-OF-SELECTION.
IF sy-tcode EQ 'SE38' OR sy-tcode EQ 'SA38'.
MESSAGE s035.
EXIT.
ENDIF.
CREATE OBJECT go_bluesky_program
EXPORTING
i_home_base = p_hbad.
IF p_imm = 'X' OR p_batch = 'X'.
******** Get data from database
PERFORM get_data_from_db.
IF p_batch = 'X'.
*******Save the data the server as .txt file, it will run at backgroup Job
PERFORM save_data_to_server USING <gt_output>
p_hbad
gv_run_time
gv_run_date
sy-uname
gv_top_folder
p_file
go_bluesky_program->gt_fieldcat_lvc.
EXIT.
ENDIF.
ELSE.
******** Get data from server
PERFORM get_data_from_server.
ENDIF.
IF <gt_output> IS ASSIGNED AND <gt_output> IS NOT INITIAL.
IF p_xls = 'X' AND p_batch = ''.
PERFORM output_excel.
ENDIF.
PERFORM display_report.
ELSE.
MESSAGE s004(zbluesky_program).
ENDIF.
If parameter p_batch is check, The subroutine save_data_to_server will save the internal table data as .txt file at server.This is run in backgroup.Please set your focus on the function module C13Z_TEXT_WRITE
FORM save_data_to_server USING ut_internal_table TYPE STANDARD TABLE
u_home_base
u_run_time TYPE syuzeit
u_run_date TYPE sydatum
u_user TYPE syuname
u_top_folder TYPE rsmrgstr-path
u_filename TYPE g_type_file
ut_fieldcat_lvc TYPE lvc_t_fcat.
FIELD-SYMBOLS: <lt_table_dataset> TYPE STANDARD TABLE.
DATA: lv_table_ref TYPE REF TO data.
DATA: lv_filename TYPE rcgiedial-iefile.
DATA: lv_file_pattern TYPE rsmrgstr-name.
CALL METHOD go_bluesky_program->convert_data_to_dataset_format
EXPORTING
it_internal_table = ut_internal_table
it_fieldcat_lvc = ut_fieldcat_lvc
IMPORTING
et_table_ref = lv_table_ref.
ASSIGN lv_table_ref->* TO <lt_table_dataset>.
*******Create file name
PERFORM get_filename USING
u_home_base
u_user
u_run_date
u_run_time
u_filename
CHANGING lv_filename
lv_file_pattern.
******Check filename again
PERFORM check_filename_if_duplicate
USING
lv_filename
u_top_folder
lv_file_pattern.
******Create dataset path
CONCATENATE u_top_folder lv_filename INTO lv_filename.
CALL FUNCTION 'C13Z_TEXT_WRITE'
EXPORTING
i_file = lv_filename
TABLES
i_textdata_tab = <lt_table_dataset>
EXCEPTIONS
no_permission = 1
open_failed = 2
ap_file_exists = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e021.
ENDIF.
ENDFORM. " save_data_to_server
If parameter p_ser is check, The subroutine get_data_from_server will read the data from .txt file in server and put it into internal table. Please focus on the DO looping in the subroutine.It is the codes for reading data from .txt file into internal table.
FORM get_data_from_server .
FIELD-SYMBOLS: <lt_table_dataset> TYPE STANDARD TABLE,
<ls_line_dataset> TYPE ANY,
<field_runtime> TYPE ANY,
<field_dataset> TYPE ANY.
DATA: lv_table_ref TYPE REF TO data,
lv_line_ref TYPE REF TO data.
DATA: lv_file TYPE string.
DATA: ls_file_record TYPE rsfillst.
DATA: ls_fieldcat_lvc TYPE lvc_s_fcat.
PERFORM build_output_table.
******Get the dataset format(all the fiels are CHAR type)
CALL METHOD go_bluesky_program->convert_data_to_dataset_format
EXPORTING
it_internal_table = <gt_output>
it_fieldcat_lvc = go_bluesky_program->gt_fieldcat_lvc
IMPORTING
et_table_ref = lv_table_ref.
ASSIGN lv_table_ref->* TO <lt_table_dataset>.
CREATE DATA lv_line_ref LIKE LINE OF <lt_table_dataset>.
ASSIGN lv_line_ref->* TO <ls_line_dataset>.
PERFORM get_file_record
USING
sy-mandt
sy-uname
p_hbad
gv_top_folder
CHANGING
ls_file_record.
CONCATENATE ls_file_record-dirname ls_file_record-name INTO lv_file.
OPEN DATASET lv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
MESSAGE e030 WITH p_txt.
ENDIF.
DO.
READ DATASET lv_file INTO <ls_line_dataset>.
IF sy-subrc EQ 0.
IF <ls_line_dataset> IS NOT INITIAL.
APPEND <ls_line_dataset> TO <lt_table_dataset>.
CLEAR <ls_line_dataset>.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET lv_file.
IF p_del = 'X'.
DELETE DATASET lv_file.
ENDIF.
* break chengr.
LOOP AT <lt_table_dataset> ASSIGNING <ls_line_dataset>.
LOOP AT go_bluesky_program->gt_fieldcat_lvc INTO ls_fieldcat_lvc.
ASSIGN COMPONENT ls_fieldcat_lvc-fieldname
OF STRUCTURE <ls_line_dataset> TO <field_dataset>.
ASSIGN COMPONENT ls_fieldcat_lvc-fieldname
OF STRUCTURE <gs_output> TO <field_runtime>.
<field_runtime> = <field_dataset>.
ENDLOOP.
APPEND <gs_output> TO <gt_output>.
ENDLOOP.
At last, I think you understand how to display it in ALV . -
How to avoid using bapi_commit inside a loop .
Hi ,
Need a help.
This is a program for uploading business partners in CRM.
The basic logic of the program is as below:
- There are two types of records in the upload file new/ old ones to be updated
- A new record is identified by checking if a BP exits based on the cust id
- In case it is a new record certain BAPIs are called to create a new BP, else the address details, identification etc are updated for the existing one.
- SQL analysis of the program showed that the maximum amount of time is taken in INSERT/UPDTAE/COMMIT processes.
When we raised the issue with SAP , they stated that the problem occurs due to the very high no of BAPI_COMMIT calls which is within the loop.
The standard BAPI available allows passing of one record at a time. Hence passing multiple records at a time and a single commit did not seem feasible.
Also while updating since there are different BAPIs for address and identification it is being called in a sequence and commit issued after each. If commit is excluded it gives a locking error since the first BAPI tends to lock the record and does not allow subsequent BAPI call
kindly suggest me with a solution of using a less commit for updating series of records.
The code is as follows:
*& Report ZBP_BDCP_ACCTRNSDATA_UPLOAD *
*& Created By : Radhu Shankar.G *
*& Purpose : Program to Create Investors with the transaction *
*& data received from the De-dupe Software. *
*& Note : Can be Executed or scheduled only in Background *
REPORT zbp_bdcp_acctrnsdata_upload LINE-SIZE 255 LINE-COUNT 65 NO STANDARD PAGE HEADING
MESSAGE-ID zcrm_upload.
TABLES : bbp_iu01.
Selection Screen
SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: p_file TYPE string LOWER CASE OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK blk1.
SELECTION-SCREEN: BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
SELECT-OPTIONS:s_email FOR bbp_iu01-email NO INTERVALS.
SELECTION-SCREEN: END OF BLOCK blk2.
SELECTION-SCREEN: BEGIN OF BLOCK blk3 WITH FRAME TITLE text-003.
SELECTION-SCREEN COMMENT /1(72) text-004.
SELECTION-SCREEN COMMENT /1(72) text-006.
SELECTION-SCREEN COMMENT /1(72) text-007.
SELECTION-SCREEN COMMENT /1(72) text-005.
SELECTION-SCREEN: END OF BLOCK blk3.
Data Declaration
Main Upload structure and internal table
DATA : BEGIN OF i_main,
cust_id TYPE bu_bpext, " Customer ID
inv_type_code TYPE crmt_mktpfchr_atvalue, " Investor Type Code
insti_tag TYPE crmt_mktpfchr_atvalue, " Retail/Instituitional Tag
name TYPE char120, " Name
address1 TYPE ad_strspp1, " Address1
address2 TYPE ad_strspp2, " Address2
address3 TYPE ad_street, " Address3
city TYPE ad_city1, " City
state TYPE t005u-bezei, " Region/State
country TYPE landx50, " Country
pin_code TYPE ad_pstcd1, " Pin Code
off_phone1 TYPE ad_tlnmbr, " Office Telephone Number1
off_phone2 TYPE ad_tlnmbr, " Office Telephone Number2
res_phone1 TYPE ad_tlnmbr, " Residence Telephone Number1
res_phone2 TYPE ad_tlnmbr, " Residence Telephone Number1
mobile TYPE ad_mbnmbr1, " Mobile Number
email TYPE ad_smtpadr, " Email ID
birth_date TYPE bu_birthdt, " Birth Date
pan_no TYPE bu_id_number, " Pan Number
lob TYPE crmt_mktpfchr_atvalue, " Line of Business
fam_tag TYPE bu_id_number, " FAM Tag Number
mod_date TYPE sy-datum, " Modified Date
END OF i_main.
DATA : it_main LIKE i_main OCCURS 0 WITH HEADER LINE.
Error file structure and internal table
DATA : BEGIN OF i_error,
cust_id TYPE bu_bpext, " Customer ID
inv_type_code TYPE crmt_mktpfchr_atvalue, " Investor Type Code
insti_tag TYPE crmt_mktpfchr_atvalue, " Retail/Instituitional Tag
name TYPE char120, " Name
address1 TYPE ad_strspp1, " Address1
address2 TYPE ad_strspp2, " Address2
address3 TYPE ad_street, " Address3
city TYPE ad_city1, " City
state TYPE t005u-bezei, " Region/State
country TYPE landx50, " Country
pin_code TYPE ad_pstcd1, " Pin Code
off_phone1 TYPE ad_tlnmbr, " Office Telephone Number1
off_phone2 TYPE ad_tlnmbr, " Office Telephone Number2
res_phone1 TYPE ad_tlnmbr, " Residence Telephone Number1
res_phone2 TYPE ad_tlnmbr, " Residence Telephone Number1
mobile TYPE ad_mbnmbr1, " Mobile Number
email TYPE ad_smtpadr, " Email ID
birth_date TYPE bu_birthdt, " Birth Date
pan_no TYPE bu_id_number, " Pan Number
lob TYPE crmt_mktpfchr_atvalue, " Line of Business
fam_tag TYPE bu_id_number, " FAM Tag Number
mod_date TYPE sy-datum, " Modified Date
bp TYPE bapibus1006_head-bpartner, " BP
recno(4) TYPE c, " Record No
message(255) TYPE c, " Error Message
END OF i_error.
DATA : it_error LIKE i_error OCCURS 0 WITH HEADER LINE.
BP Telephone, Email & Role Details
DATA : w_bp_tel TYPE bapiadtel,
it_bp_tel TYPE bapiadtel OCCURS 0 WITH HEADER LINE,
it_bp_tel1 TYPE bapiadtel OCCURS 0 WITH HEADER LINE,
it_bp_email TYPE bapiadsmtp OCCURS 0 WITH HEADER LINE,
it_bp_email1 TYPE bapiadsmtp OCCURS 0 WITH HEADER LINE,
it_bapicomrem TYPE STANDARD TABLE OF bapicomrem WITH HEADER LINE,
it_bapicomrem_x TYPE STANDARD TABLE OF bapicomrex WITH HEADER LINE,
it_tel_x TYPE STANDARD TABLE OF bapiadtelx WITH HEADER LINE,
it_email_x TYPE STANDARD TABLE OF bapiadsmtx WITH HEADER LINE,
it_role TYPE bapibusisb990_bproles OCCURS 0 WITH HEADER LINE,
it_role_cp TYPE bapibusisb990_bproles OCCURS 0 WITH HEADER LINE.
BP Identication Details
DATA: BEGIN OF it_identification OCCURS 0,
idcategory TYPE bapibus1006_identification_key-identificationcategory,
idnumber TYPE bapibus1006_identification_key-identificationnumber,
END OF it_identification.
DATA : w_identification TYPE bapibus1006_identification.
BP Marketing Attributes
DATA : BEGIN OF it_crmt OCCURS 0,
crmt TYPE crmt_mktprof_keys-profile_template_id,
END OF it_crmt.
DATA : it_crmt1 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_crmt2 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_crmt3 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_crmt4 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_crmt5 TYPE STANDARD TABLE OF crmt_mktprof_comw WITH HEADER LINE,
it_bp_ret TYPE STANDARD TABLE OF bapiret2 WITH HEADER LINE.
BP Basic Details
DATA : v_partn_cat TYPE bapibus1006_head-partn_cat,
w_central TYPE bapibus1006_central,
w_central_x TYPE bapibus1006_central_x,
w_central_org TYPE bapibus1006_central_organ,
w_central_per TYPE bapibus1006_central_person,
w_central_group TYPE bapibus1006_central_group,
w_centralorg_x TYPE bapibus1006_central_organ_x,
w_centralperson_x TYPE bapibus1006_central_person_x,
w_centralgrp_x TYPE bapibus1006_central_group_x,
w_address TYPE bapibus1006_address,
w_addr_x TYPE bapibus1006_address_x,
v_bp TYPE bapibus1006_head-bpartner.
Declaration for Duplication Check
DATA : w_zacc_address TYPE zacc_address,
g_dup_status TYPE i.
DATA : it_dup_bp TYPE STANDARD TABLE OF zbuspartner WITH HEADER LINE.
CONSTANTS: c_pan TYPE bu_id_type VALUE 'ZID003',
c_fam_tag TYPE bu_id_type VALUE 'ZID011',
c_cust TYPE bu_id_type VALUE 'ZID009'.
Other Declarations
DATA : v_inv_type TYPE crmt_mktpfchr_atvalue, " Investor Type Code
v_file TYPE string,
v_firstname TYPE bu_nameor1,
v_filename1(14) TYPE c,
v_filename2(14) TYPE c,
v_lines TYPE int4,
v_cat TYPE bu_type,
recno TYPE int4,
loopno TYPE int4,
it_iden_ret TYPE bapiret2 OCCURS 0,
it_attr_ret TYPE bapiret2 OCCURS 0,
it_role_ret TYPE bapiret2 OCCURS 0,
wa_iden_ret TYPE bapiret2,
wa_attr_ret TYPE bapiret2,
it_iden_flag TYPE c,
it_attr_flag TYPE c,
flag_central TYPE c,
flag_addr TYPE c,
flag_bp TYPE c,
flag_suc TYPE c,
flag_exist TYPE c,
flag_exit TYPE c,
g_bp_msg TYPE string,
g_bp_msg1 TYPE string.
DATA : BEGIN OF i_success,
rec TYPE int4, "Record
name TYPE bu_nameor1, "Name
bp TYPE bapibus1006_head-bpartner, "Business Partner
END OF i_success,
it_success LIKE i_success OCCURS 0 WITH HEADER LINE,
it_upd_success LIKE i_success OCCURS 0 WITH HEADER LINE.
Data Declaration for converting spool request to PDF and to trigger mail
DATA : gd_recsize TYPE i.
Spool IDs
TYPES : BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES : END OF t_tbtcp.
DATA : it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA : gd_eventid LIKE tbtcm-eventid,
gd_eventparm LIKE tbtcm-eventparm,
gd_external_program_active LIKE tbtcm-xpgactive,
gd_jobcount LIKE tbtcm-jobcount,
gd_jobname LIKE tbtcm-jobname,
gd_stepcount LIKE tbtcm-stepcount,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA : w_recsize TYPE i.
DATA : gd_subject LIKE sodocchgi1-obj_descr,
it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_sender_type LIKE soextreci1-adr_typ,
gd_attachment_desc TYPE so_obj_nam,
gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA : gd_spool_nr LIKE tsp01-rqident,
gd_destination LIKE rlgrap-filename,
gd_bytecount LIKE tst01-dsize,
gd_buffer TYPE string.
Binary store for PDF
DATA : BEGIN OF it_pdf_output OCCURS 0.
INCLUDE STRUCTURE tline.
DATA : END OF it_pdf_output.
DATA : v_email1 TYPE somlreci1-receiver,
v_sender TYPE somlreci1-receiver.
CONSTANTS: c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL',
c_delspl TYPE c VALUE 'X'.
DATA : BEGIN OF result OCCURS 0,
line(100) TYPE c,
END OF result.
DATA:i_id_tab TYPE STANDARD TABLE OF bapibus1006_id_details WITH HEADER LINE.
eliminting the error for convt page error
data: g_spl type c value ''.
eliminting the error for convt page error
Initialization
Renaming the target file daily
CONCATENATE '_' sy-datum '.txt' INTO v_filename1.
CONCATENATE '_' sy-datum '.TXT' INTO v_filename2.
START-OF-SELECTION
START-OF-SELECTION.
SELECT COUNT(*) FROM zbp_tax_status.
IF sy-subrc <> 0.
SKIP 2.
WRITE:/ text-011.
STOP.
ENDIF.
REFRESH : it_main.
Uploading the file from either presentatinon layer or application server
PERFORM file_upload.
Creating the BP number and assigning & adding up other attributes
LOOP AT it_main.
PERFORM data_fill. " Filling up global structures & variables
IF v_bp IS INITIAL.
PERFORM duplication_check. " Duplication check
ENDIF.
PERFORM bp_creation. " BP Creation
PERFORM return_fill. " Filling up Return Tables
CLEAR : v_bp, it_main, flag_exit, g_dup_status, it_identification, it_crmt, it_crmt1, it_crmt2, it_crmt3, it_crmt4, it_crmt5,
w_bp_tel,it_bp_tel,it_bp_tel1,it_bp_email,it_bp_email1,it_tel_x,it_email_x,w_addr_x,w_centralorg_x,w_centralperson_x,
w_centralgrp_x,flag_addr,flag_central,it_iden_flag,it_attr_flag,it_bapicomrem,w_central,w_central_x, v_inv_type,it_bapicomrem_x,
w_central_org,w_central_per,w_central_group,flag_bp,flag_suc,flag_exist,it_bp_ret,g_bp_msg,g_bp_msg1,v_cat,wa_attr_ret.
REFRESH :it_identification, it_crmt, it_crmt1, it_crmt2, it_crmt3, it_crmt4, it_crmt5,it_bapicomrem,
it_bp_tel,it_bp_tel1,it_bp_email,it_bp_email1,it_tel_x,it_email_x,it_bp_ret,it_bapicomrem_x.
ENDLOOP.
Downloading the file to be reprocessed to the application server
IF it_error[] IS NOT INITIAL.
PERFORM error_file_download.
ENDIF.
Constructing the Return Messages for the Job
PERFORM return_messages. " Return Message Construction
Converting the return messages into PDF file and trigerring a mail notification
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
PERFORM trigger_email.
ENDIF.
*& Form file_upload
FORM file_upload .
Data declatration
DATA: l_filestr TYPE string.
CLASS cl_abap_char_utilities DEFINITION LOAD.
CONSTANTS: con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
REPLACE '.txt' WITH v_filename1 INTO p_file .
REPLACE '.TXT' WITH v_filename2 INTO p_file .
MOVE p_file TO v_file.
IF sy-batch EQ 'X'.
Uploading the file from application server if the job is scheduled in background
OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT
eliminting the error for convt page error
IGNORING CONVERSION ERRORS REPLACEMENT CHARACTER g_spl.
eliminting the error for convt page error
IF sy-subrc = 0.
DO.
READ DATASET p_file INTO l_filestr.
IF sy-subrc <> 0.
EXIT.
ELSE.
CLEAR it_main.
SPLIT l_filestr AT con_tab INTO:
it_main-cust_id it_main-inv_type_code
it_main-insti_tag it_main-name
it_main-address1 it_main-address2
it_main-address3 it_main-city
it_main-state it_main-country
it_main-pin_code it_main-off_phone1
it_main-off_phone2 it_main-res_phone1
it_main-res_phone2 it_main-mobile
it_main-email it_main-birth_date
it_main-pan_no it_main-lob
it_main-fam_tag it_main-mod_date.
APPEND it_main.
ENDIF.
ENDDO.
ELSE.
WRITE : / 'The file',
p_file,
'is not found.'.
STOP.
ENDIF.
CLOSE DATASET p_file.
ELSE.
WRITE : / 'The Program can only be executed in the background.'.
STOP.
ENDIF.
CLEAR : l_filestr, it_main.
ENDFORM. " file_upload
*& Form data_fill
FORM data_fill .
Filling up Partner Category (v_Partn_cat) ,workarea (w_central), workarea (w_central_org) & workarea (w_central_per)
SELECT SINGLE bp_category tax_status FROM zbp_tax_status
INTO (v_partn_cat,v_inv_type)
WHERE inv_code EQ it_main-inv_type_code.
Filling up the Authorization Group
IF it_main-lob EQ 'M' AND it_main-insti_tag EQ 'N'.
w_central-authorizationgroup = 'ZMFR'.
ELSEIF it_main-lob EQ 'M' AND it_main-insti_tag EQ 'Y'.
w_central-authorizationgroup = 'ZMFI'.
ELSEIF it_main-lob EQ 'P' AND it_main-insti_tag EQ 'N'.
w_central-authorizationgroup = 'ZPMR'.
ELSEIF it_main-lob EQ 'P' AND it_main-insti_tag EQ 'Y'.
w_central-authorizationgroup = 'ZPMI'.
ELSEIF it_main-lob EQ 'A' AND it_main-insti_tag EQ 'N'.
w_central-authorizationgroup = 'ZBOR'.
ELSEIF it_main-lob EQ 'A' AND it_main-insti_tag EQ 'Y'.
w_central-authorizationgroup = 'ZBOI'.
ENDIF.
Filling up workarea (w_address)
IF it_main-address1 IS NOT INITIAL.
MOVE : it_main-address1 TO w_address-str_suppl1,
it_main-address1 TO w_zacc_address-address1,
'X' TO w_addr_x-str_suppl1 .
ENDIF.
IF it_main-address2 IS NOT INITIAL.
MOVE : it_main-address2 TO w_address-str_suppl2,
it_main-address2 TO w_zacc_address-address2,
'X' TO w_addr_x-str_suppl2 .
ENDIF.
IF it_main-address3 IS NOT INITIAL.
MOVE : it_main-address3 TO w_address-street,
it_main-address3 TO w_zacc_address-address3,
'X' TO w_addr_x-street.
ENDIF.
IF it_main-city IS NOT INITIAL.
MOVE : it_main-city TO w_address-city,
it_main-city TO w_zacc_address-city,
'X' TO w_addr_x-city.
ENDIF.
IF it_main-pin_code IS NOT INITIAL.
MOVE : it_main-pin_code TO w_address-postl_cod1,
'X' TO w_addr_x-postl_cod1.
TRANSLATE w_address-postl_cod1 TO UPPER CASE.
ENDIF.
IF it_main-country IS NOT INITIAL.
MOVE : 'X' TO w_addr_x-country.
ENDIF.
IF it_main-state IS NOT INITIAL.
MOVE: 'X' TO w_addr_x-region.
ENDIF.
Picking up Country & State Codes
SELECT SINGLE land1 FROM t005t INTO w_address-country
WHERE spras EQ 'E'
AND landx50 EQ it_main-country.
IF sy-subrc EQ 0.
SELECT SINGLE bland FROM t005u INTO w_address-region
WHERE spras EQ 'E'
AND land1 EQ w_address-country
AND bezei EQ it_main-state.
IF sy-subrc NE 0.
w_address-region = 'ZZ'.
ENDIF.
ELSE.
w_address-country = 'ZZ'.
SELECT SINGLE bland FROM t005u INTO w_address-region
WHERE spras EQ 'E'
AND land1 EQ w_address-country
AND bezei EQ it_main-state.
IF sy-subrc NE 0.
w_address-region = 'ZZ'.
ENDIF.
ENDIF.
w_zacc_address-country = w_address-country.
w_zacc_address-state = w_address-region.
Filling up the BP Role Detail
it_role-partnerrole = 'Z1INVS'.
APPEND it_role.
Finding out the BP number from the client ID
IF it_main-cust_id IS NOT INITIAL.
SELECT SINGLE partner FROM but0id INTO v_bp
WHERE type EQ 'ZID009'
AND idnumber EQ it_main-cust_id.
IF sy-subrc = 0.
SELECT SINGLE type FROM but000 INTO v_cat
WHERE partner = v_bp.
PERFORM name_processing USING v_cat.
ENDIF.
ENDIF.
IF v_bp IS INITIAL.
PERFORM name_processing USING v_partn_cat. " Processing the Name & Title depending on partner category
Filling up the Identication Number Details
IF it_main-cust_id IS NOT INITIAL. " Customer ID
it_identification-idcategory = 'ZID009'.
it_identification-idnumber = it_main-cust_id.
APPEND it_identification.
CLEAR it_identification.
ENDIF.
IF it_main-pan_no IS NOT INITIAL. " Pan Number
it_identification-idcategory = 'ZID003'.
it_identification-idnumber = it_main-pan_no.
APPEND it_identification.
CLEAR it_identification.
ENDIF.
IF it_main-fam_tag IS NOT INITIAL. " Family Tag Number
it_identification-idcategory = 'ZID011'.
it_identification-idnumber = it_main-fam_tag.
APPEND it_identification.
CLEAR it_identification.
ENDIF.
Filling up the Marketing Attributes
IF v_inv_type IS NOT INITIAL. " Tax status
it_crmt1-atname = 'TAX_STATUS'.
it_crmt1-atwrt = v_inv_type.
APPEND it_crmt1.
CLEAR : it_crmt1.
ENDIF.
IF it_main-lob IS NOT INITIAL. " Product Tag
it_crmt1-atname = 'LOB'.
IF it_main-lob EQ 'M'.
it_crmt1-atwrt = 'MF'.
ELSEIF it_main-lob EQ 'P'.
it_crmt1-atwrt = 'PMS'.
ELSEIF it_main-lob EQ 'A'.
it_crmt1-atwrt = 'BOTH'.
ENDIF.
APPEND it_crmt1.
CLEAR : it_crmt1.
ENDIF.
IF it_main-insti_tag IS NOT INITIAL. " Retail/Instituitional Tag
it_crmt1-atname = 'ORGANISATION_STRUCTURE'.
IF it_main-insti_tag EQ 'N'.
it_crmt1-atwrt = 'RETAIL'.
ELSEIF it_main-insti_tag EQ 'Y'.
it_crmt1-atwrt = 'INSTITUTIONAL'.
ELSEIF it_main-insti_tag EQ 'F'.
it_crmt1-atwrt = 'INTERNATIONAL'.
ENDIF.
APPEND it_crmt1.
CLEAR : it_crmt1.
ENDIF.
it_crmt2-atname = 'VIP'.
it_crmt2-atwrt = 'NOT CLASSIFIED'.
APPEND it_crmt2.
CLEAR : it_crmt2.
it_crmt3-atname = 'PRIORITY'.
it_crmt3-atwrt = 'NOT CLASSIFIED'.
APPEND it_crmt3.
CLEAR : it_crmt3.
it_crmt4-atname = 'CONTACTBLE'.
it_crmt4-atwrt = 'NOT CLASSIFIED'.
APPEND it_crmt4.
CLEAR : it_crmt4.
it_crmt5-atname = 'SOURCE'.
it_crmt5-atwrt = 'CAMS'.
APPEND it_crmt5.
CLEAR : it_crmt5.
it_crmt-crmt = 'CENTALISED_CLF_INV'.
APPEND it_crmt.
it_crmt-crmt = 'GENERAL_CLF_INV'.
APPEND it_crmt.
it_crmt-crmt = 'MF_CLF_INV'.
APPEND it_crmt.
it_crmt-crmt = 'PMS_CLF_INV'.
APPEND it_crmt.
it_crmt-crmt = 'SOURCE'.
APPEND it_crmt.
CLEAR it_crmt-crmt.
ENDIF.
For Return Message
recno = recno + 1.
ENDFORM. " data_fill
*& Form duplication_check
FORM duplication_check .
DATA : l_lines TYPE i.
IF v_firstname IS NOT INITIAL.
CALL FUNCTION 'ZACC_DUPLICATIONCHECK'
EXPORTING
role = 'Z1INVS'
firstname = v_firstname
pan_no = it_main-pan_no
mobile = it_main-mobile
email = it_main-email
address = w_zacc_address
partnercategory = v_partn_cat
IMPORTING
status = g_dup_status
TABLES
buspartner = it_dup_bp.
DESCRIBE TABLE it_dup_bp LINES l_lines.
IF l_lines EQ 1.
IF g_dup_status EQ 1.
READ TABLE it_dup_bp INDEX 1.
MOVE it_dup_bp-partner TO v_bp.
ELSEIF g_dup_status EQ 2.
flag_exit = 'X'.
ENDIF.
ELSEIF l_lines GT 1.
flag_exit = 'X'.
ENDIF.
ENDIF.
CLEAR : l_lines, v_firstname.
ENDFORM. " duplication_check
*& Form name_processing
FORM name_processing USING uv_cat TYPE bu_type.
IF it_main-name IS NOT INITIAL.
If category is Person
IF uv_cat EQ 1.
CALL FUNCTION 'ZGET_NAME_FROM_STRING'
EXPORTING
name = it_main-name
IMPORTING
first = w_central_per-firstname
middle = w_central_per-middlename
last = w_central_per-lastname.
w_centralperson_x-firstname = 'X'.
w_centralperson_x-middlename = 'X'.
w_centralperson_x-lastname = 'X'.
w_centralperson_x-birthdate = 'X'.
MOVE : it_main-birth_date TO w_central_per-birthdate,
w_central_per-firstname TO v_firstname.
ELSEIF uv_cat EQ 2.
If category is organisation
CALL FUNCTION 'ZGET_NAME_FROM_STRING'
EXPORTING
name = it_main-name
IMPORTING
first = w_central_org-name2
middle = w_central_org-name1
last = w_central_org-name3.
w_centralorg_x-name1 = 'X'.
w_centralorg_x-name2 = 'X'.
w_centralorg_x-name3 = 'X'.
MOVE w_central_org-name2 TO v_firstname.
ELSEIF uv_cat EQ 3.
If category is group
CALL FUNCTION 'ZGET_NAME_FROM_STRING'
EXPORTING
name = it_main-name
IMPORTING
first = w_central_group-namegroup2
middle = w_central_group-namegroup1.
w_centralgrp_x-namegroup1 = 'X'.
w_centralgrp_x-namegroup2 = 'X'.
MOVE w_central_group-namegroup2 TO v_firstname.
ENDIF.
MOVE : it_main-name+0(8) TO w_central-searchterm1,
'X' TO w_central_x-searchterm1.
ENDIF.
ENDFORM. " name_processing
*& Form bp_creation
FORM bp_creation.
DATA:l_identification TYPE bapibus1006_identification_key-identificationnumber.
BP Creation
IF v_bp IS INITIAL.
Filling up the Telephone Details
MOVE : w_address-country TO w_bp_tel-country.
IF it_main-off_phone1 IS NOT INITIAL. " Office Telephone1
w_bp_tel-r_3_user = '1'.
w_bp_tel-telephone = it_main-off_phone1.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-r_3_user, w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'OFFICE PHONE1'.
APPEND it_bapicomrem.
ENDIF.
IF it_main-off_phone2 IS NOT INITIAL. " Office Telephone2
w_bp_tel-telephone = it_main-off_phone2.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'OFFICE PHONE2'.
APPEND it_bapicomrem.
ENDIF.
IF it_main-res_phone1 IS NOT INITIAL. " Residence Telephone1
w_bp_tel-telephone = it_main-res_phone1.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'RESIDENCE PHONE1'.
APPEND it_bapicomrem.
ENDIF.
IF it_main-res_phone2 IS NOT INITIAL. " Residence Telephone2
w_bp_tel-telephone = it_main-res_phone2.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'RESIDENCE PHONE2'.
APPEND it_bapicomrem.
ENDIF.
IF it_main-mobile IS NOT INITIAL. " Mobile Number
w_bp_tel-r_3_user = '3'.
w_bp_tel-telephone = it_main-mobile.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-r_3_user, w_bp_tel-telephone.
ENDIF.
Filling up the E-Mail Details
IF it_main-email IS NOT INITIAL. " E-mail1
it_bp_email-e_mail = it_main-email.
APPEND it_bp_email.
CLEAR it_bp_email.
ENDIF.
BAPI for BP creation
CALL FUNCTION 'BAPI_BUPA_FS_CREATE_FROM_DATA2'
EXPORTING
partnercategory = v_partn_cat
centraldata = w_central
centraldataperson = w_central_per
centraldataorganization = w_central_org
centraldatagroup = w_central_group
addressdata = w_address
IMPORTING
businesspartner = v_bp
TABLES
telefondata = it_bp_tel
communicationnotes = it_bapicomrem
e_maildata = it_bp_email
roles = it_role
return = it_bp_ret.
IF v_bp IS NOT INITIAL.
flag_bp = 'X'.
ENDIF.
Commiting the transaction
PERFORM transaction_commit.
To add Identification details to BP
PERFORM add_details.
CLEAR : v_partn_cat, w_central, w_central_per, w_central_org, it_bp_tel, it_bp_email, it_role.
REFRESH : it_bp_tel, it_bp_email, it_role.
ELSE.
flag_exist = 'X'.
If BP exists,address,communication and ID details will be updated
CALL FUNCTION 'BAPI_BUPA_CENTRAL_CHANGE'
EXPORTING
businesspartner = v_bp
centraldata = w_central
centraldataperson = w_central_per
centraldataorganization = w_central_org
centraldatagroup = w_central_group
centraldata_x = w_central_x
centraldataperson_x = w_centralperson_x
centraldataorganization_x = w_centralorg_x
centraldatagroup_x = w_centralgrp_x
TABLES
return = it_bp_ret.
READ TABLE it_bp_ret WITH KEY type = 'E'.
IF sy-subrc = 0.
flag_central = 'E'.
g_bp_msg = it_bp_ret-message.
CLEAR:it_bp_ret.
REFRESH:it_bp_ret.
ELSE.
flag_suc = 'X'.
ENDIF.
PERFORM transaction_commit.
To get the existing communication details
CALL FUNCTION 'BAPI_BUPA_ADDRESS_GETDETAIL'
EXPORTING
businesspartner = v_bp
TABLES
bapiadtel = it_bp_tel1
bapiadsmtp = it_bp_email1.
LOOP AT it_bp_tel1 WHERE r_3_user = '1' OR r_3_user = ' '.
it_bp_tel-consnumber = it_bp_tel1-consnumber.
it_tel_x-updateflag = 'D'.
APPEND:it_bp_tel,
it_tel_x.
CLEAR: it_bp_tel,
it_tel_x.
ENDLOOP.
IF it_main-mobile IS NOT INITIAL .
LOOP AT it_bp_tel1 WHERE r_3_user = '2' OR r_3_user = '3'.
it_bp_tel-consnumber = it_bp_tel1-consnumber.
it_tel_x-updateflag = 'D'.
APPEND:it_bp_tel,
it_tel_x.
CLEAR: it_bp_tel,
it_tel_x.
ENDLOOP.
ENDIF.
*Updating communication details
IF it_main-off_phone1 IS NOT INITIAL. " Office Telephone1
w_bp_tel-r_3_user = '1'.
w_bp_tel-telephone = it_main-off_phone1.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR: it_tel_x.
APPEND w_bp_tel TO it_bp_tel.
CLEAR : w_bp_tel-r_3_user, w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'OFFICE PHONE1'.
APPEND it_bapicomrem.
it_bapicomrem_x-comm_type = 'I'.
it_bapicomrem_x-langu = 'I'.
it_bapicomrem_x-comm_notes = 'I'.
it_bapicomrem_x-updateflag = 'I'.
APPEND it_bapicomrem_x.
ENDIF.
IF it_main-off_phone2 IS NOT INITIAL. " Office Telephone2
w_bp_tel-telephone = it_main-off_phone2.
APPEND w_bp_tel TO it_bp_tel.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR:it_tel_x.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'OFFICE PHONE2'.
APPEND it_bapicomrem.
it_bapicomrem_x-comm_type = 'I'.
it_bapicomrem_x-langu = 'I'.
it_bapicomrem_x-comm_notes = 'I'.
it_bapicomrem_x-updateflag = 'I'.
APPEND it_bapicomrem_x.
ENDIF.
IF it_main-res_phone1 IS NOT INITIAL. " Residence Telephone1
w_bp_tel-telephone = it_main-res_phone1.
APPEND w_bp_tel TO it_bp_tel.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR:it_tel_x.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'RESIDECE PHONE1'.
APPEND it_bapicomrem.
it_bapicomrem_x-comm_type = 'I'.
it_bapicomrem_x-langu = 'I'.
it_bapicomrem_x-comm_notes = 'I'.
it_bapicomrem_x-updateflag = 'I'.
APPEND it_bapicomrem_x.
ENDIF.
IF it_main-res_phone2 IS NOT INITIAL. " Residence Telephone2
w_bp_tel-telephone = it_main-res_phone2.
APPEND w_bp_tel TO it_bp_tel.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR:it_tel_x.
CLEAR : w_bp_tel-telephone.
it_bapicomrem-comm_type = 'TEL'.
it_bapicomrem-langu = 'EN'.
it_bapicomrem-comm_notes = 'RESIDECE PHONE2'.
APPEND it_bapicomrem.
it_bapicomrem_x-comm_type = 'I'.
it_bapicomrem_x-langu = 'I'.
it_bapicomrem_x-comm_notes = 'I'.
it_bapicomrem_x-updateflag = 'I'.
APPEND it_bapicomrem_x.
ENDIF.
IF it_main-mobile IS NOT INITIAL. " Mobile Number
w_bp_tel-r_3_user = '3'.
w_bp_tel-telephone = it_main-mobile.
APPEND w_bp_tel TO it_bp_tel.
it_tel_x-telephone = 'I'.
it_tel_x-updateflag = 'I'.
APPEND:it_tel_x.
CLEAR:it_tel_x.
CLEAR : w_bp_tel-r_3_user, w_bp_tel-telephone.
ENDIF.
IF it_main-email IS NOT INITIAL.
LOOP AT it_bp_email1.
it_bp_email-consnumber = it_bp_email1-consnumber.
it_email_x-updateflag = 'D'.
APPEND:it_bp_email,
it_email_x.
ENDLOOP.
it_bp_email-e_mail = it_main-email.
it_email_x-e_mail = 'I'.
it_email_x-updateflag = 'I'.
APPEND:it_bp_email,
it_email_x.
CLEAR:it_bp_email,
it_email_x.
ENDIF.
REFRESH:it_bp_ret.
BP Change
CALL FUNCTION 'BAPI_BUPA_ADDRESS_CHANGE'
EXPORTING
businesspartner = v_bp
addressdata = w_address
addressdata_x = w_addr_x
TABLES
bapiadtel = it_bp_tel
bapicomrem = it_bapicomrem
bapiadtel_x = it_tel_x
bapiadsmtp = it_bp_email
bapiadsmt_x = it_email_x
bapicomre_x = it_bapicomrem_x
return = it_bp_ret.
READ TABLE it_bp_ret WITH KEY type = 'E'.
IF sy-subrc = 0.
flag_addr = 'E'.
g_bp_msg1 = it_bp_ret-message.
ELSE.
flag_suc = 'X'.
ENDIF.
PERFORM transaction_commit.
REFRESH it_bp_ret.
IF it_main-pan_no IS NOT INITIAL OR it_main-fam_tag IS NOT INITIAL OR it_main-cust_id IS NOT INITIAL.
Retreiving the existing Identification details
PERFORM id_get USING v_bp.
ENDIF.
PAN number addition
IF it_main-pan_no IS NOT INITIAL.
CLEAR l_identification.
MOVE it_main-pan_no TO l_identification.
TRANSLATE l_identification TO UPPER CASE.
READ TABLE i_id_tab WITH KEY identificationtype = c_pan.
IF sy-subrc = 0.
To remove existing PAN number
PERFORM id_remove USING v_bp c_pan i_id_tab-identificationnumber.
READ TABLE it_iden_ret INTO wa_iden_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
it_iden_flag = 'E'.
ELSE.
flag_suc = 'X'.
Performing transaction commit
PERFORM transaction_commit.
ENDIF.
ENDIF.
CLEAR:it_iden_ret[],it_iden_ret.
To add new PAN number
PERFORM id_add USING v_bp c_pan l_identification.
READ TABLE it_iden_ret INTO wa_iden_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
it_iden_flag = 'E'.
ELSE.
flag_suc = 'X'.
PERFORM transaction_commit.
ENDIF.
ENDIF.
Customer ID addition
IF it_main-cust_id IS NOT INITIAL AND ( g_dup_status = 1 ).
CLEAR l_identification.
MOVE it_main-cust_id TO l_identification.
TRANSLATE l_identification TO UPPER CASE.
READ TABLE i_id_tab WITH KEY identificationtype = c_cust.
IF sy-subrc = 0.
To remove existing Customer ID
PERFORM id_remove USING v_bp c_cust i_id_tab-identificationnumber.
READ TABLE it_iden_ret INTO wa_iden_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
it_iden_flag = 'E'.
ELSE.
Performing transaction commit
PERFORM transaction_commit.
ENDIF.
ENDIF.
CLEAR:it_iden_ret[],it_iden_ret.
To add new Customer ID number
PERFORM id_add USING v_bp c_cust l_identification.
READ TABLE it_iden_ret INTO wa_iden_ret WITH KEY type = 'E'.
IF sy-subrc EQ 0.
it_iden_flag = 'E'.
ELSE.
flag_suc ='X'.
PERFORM transaction_commit.
ENDIF.
ENDIF.
To add marketing attributes
IF it_main-insti_tag IS NOT INITIAL AND it_main-lob IS NOT INITIAL.
PERFORM add_makt_attr .
ELSE.
it_attr_flag = 'E'.Guy,i don't regard here is anybody wanna read so much code .For more constructive answers, you would distill core question from your program.
Maybe you are looking for
-
i have a requirement compare the data from two dso can we add both dso fields in one querry and create a report?
-
Error when creating user defined TYPE
Hi I have an object type created as follows create type emp_add is object(empno number(3),street varchar2(50),zipcode number(6)); when I create a type based on the Object created above using create type add_rec is emp_add; I am getting compilation er
-
Tried to upgrade as instructed and after uninstalling and reinstalling (even back to the former iTunes which I was happy with)several times, keep getting message "Procedure entry point could not be located in dynamic link library" followed by "iTune
-
Translation Problem – Region Disappearing
Translation Problem – Region Disappearing I recently started working on translating my application to German. When I apply my xlif file I have a problem with the contents of all my report regions using Vertical Report Look 2 disappear. The report reg
-
My facetime is not working what should i do
My i pad has no facetime app