How to use Call Transaction in AVL ........ for va02
Hi Experts,
I am using CALL TRANSACTION in ALV for VA02, but I want to go on item number. The following form i have used and it is working but I want to go on perticular item number in va02. pl. guide me.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'VBELN'.
READ TABLE it_out INTO wa_itab INDEX rs_selfield-tabindex.
SET PARAMETER ID : 'AUN' FIELD wa_itab-vbeln .
'APO' FIELD wa_itab-posnr.
CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
*=====================================
Yusuf
Hi,
use BDC for that....
check out the BDC part of coding for it.
REFRESH itab_bdcdata.
CLEAR itab_bdcdata.
*initial screen
PERFORM bdc_dynpro USING 'SAPMV45A'
'0102'.
PERFORM bdc_field USING 'BDC_CURSOR'
'VBAK-VBELN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'VBAK-VBELN'
<b> g_t_atpma4-vbeln.</b>
*item overview screen
PERFORM bdc_dynpro USING 'SAPMV45A'
'4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=POPO'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV45A-MABNR(04)'.
*popup screen (move item to top)
PERFORM bdc_dynpro USING 'SAPMV45A'
'0251'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RV45A-POSNR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=POSI'.
PERFORM bdc_field USING 'RV45A-POSNR'
<b>g_t_atpma4-posnr.</b>
*item overview screen
PERFORM bdc_dynpro USING 'SAPMV45A'
'4001'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'VBAP-POSNR(01)'.
PERFORM bdc_field USING 'RV45A-VBAP_SELKZ(01)'
'X'.
*Call transaction VA02
CALL TRANSACTION 'VA02' USING itab_bdcdata
MODE 'E'
UPDATE 'A'
MESSAGES INTO itab_bdcmsg.
Patil
Similar Messages
-
How to use call transaction 'XD03' in abap.
Hi Experts,
I am use call transaction xd03 in programme but when i click on any customer number the transaction xd03 is called and it show only one customer details. i.e 1 st in row . other customer details not show. so please write code to solved my problemsHi
It's not clear where you set the USER_COMMAND routine and where you set the OK_CODE for doubleclick.
I suppose you set the routine in the importing parameter I_CALLBACK_USER_COMMAND (?) becasue you aren't use the parameter for the event, but for OK_CODE?
Remember the OK_CODE should be upper case:
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
"WHEN 'kunnr'. <--------------- UPPER CASE
WHEN 'KUNNR'.
See my sample:
TYPE-POOLS SLIS.
DATA: BEGIN OF GT_FINAL OCCURS 0,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
END OF GT_FINAL.
* ALV
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GT_LAYOUT TYPE SLIS_LAYOUT_ALV,
GT_REPID LIKE SY-REPID.
START-OF-SELECTION.
SELECT KUNNR NAME1 INTO TABLE GT_FINAL
UP TO 20 ROWS
FROM KNA1.
GT_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = GT_REPID
I_INTERNAL_TABNAME = 'GT_FINAL'
I_INCLNAME = GT_REPID
CHANGING
CT_FIELDCAT = GT_FIELDCAT[].
GT_LAYOUT-F2CODE = 'KUNNR'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GT_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = GT_LAYOUT
IT_FIELDCAT = GT_FIELDCAT
TABLES
T_OUTTAB = GT_FINAL.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: GWA_FINAL LIKE GT_FINAL.
CASE R_UCOMM.
WHEN 'KUNNR'.
READ TABLE GT_FINAL INTO GWA_FINAL INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SET PARAMETER ID 'KUN' FIELD GWA_FINAL-KUNNR.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.TYPE-POOLS SLIS.
DATA: BEGIN OF GT_FINAL OCCURS 0,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
END OF GT_FINAL.
* ALV
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GT_LAYOUT TYPE SLIS_LAYOUT_ALV,
GT_REPID LIKE SY-REPID.
DATA: FL_INPUT_OFF.
START-OF-SELECTION.
SELECT KUNNR NAME1 INTO TABLE GT_FINAL
UP TO 20 ROWS
FROM KNA1.
GT_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = GT_REPID
I_INTERNAL_TABNAME = 'GT_FINAL'
I_INCLNAME = GT_REPID
CHANGING
CT_FIELDCAT = GT_FIELDCAT[].
GT_LAYOUT-F2CODE = 'KUNNR'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GT_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = GT_LAYOUT
IT_FIELDCAT = GT_FIELDCAT
TABLES
T_OUTTAB = GT_FINAL.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: GWA_FINAL LIKE GT_FINAL.
CASE R_UCOMM.
WHEN 'KUNNR'.
READ TABLE GT_FINAL INTO GWA_FINAL INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SET PARAMETER ID 'KUN' FIELD GWA_FINAL-KUNNR.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM. TYPE-POOLS SLIS.
DATA: BEGIN OF GT_FINAL OCCURS 0,
KUNNR LIKE KNA1-KUNNR,
NAME1 LIKE KNA1-NAME1,
END OF GT_FINAL.
* ALV
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
GT_LAYOUT TYPE SLIS_LAYOUT_ALV,
GT_REPID LIKE SY-REPID.
DATA: FL_INPUT_OFF.
START-OF-SELECTION.
SELECT KUNNR NAME1 INTO TABLE GT_FINAL
UP TO 20 ROWS
FROM KNA1.
GT_REPID = SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = GT_REPID
I_INTERNAL_TABNAME = 'GT_FINAL'
I_INCLNAME = GT_REPID
CHANGING
CT_FIELDCAT = GT_FIELDCAT[].
GT_LAYOUT-F2CODE = 'KUNNR'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GT_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = GT_LAYOUT
IT_FIELDCAT = GT_FIELDCAT
TABLES
T_OUTTAB = GT_FINAL.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: GWA_FINAL LIKE GT_FINAL.
CASE R_UCOMM.
WHEN 'KUNNR'.
READ TABLE GT_FINAL INTO GWA_FINAL INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SET PARAMETER ID 'KUN' FIELD GWA_FINAL-KUNNR.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
Max -
How to use call transaction stmt from webdynpro application
Hi Expers,
Can I use call transaction 'tcode' in my webdynpro application, I have tried in my application but i am getting short dump saying
Error analysis+
An exception occurred that is explained in detail below.The exception, which is assigned to class'CX_SY_SEND_DYNPRO_NO_RECEIVER', was not caught and therefore caused a runtime error. The reason for the exception is: During background processing, the system attempted to send a screen to a user. Current screen: "SAPLMGMM " 0060.
I haven't used any more statements in my application am sure from my application side everything perfect. but I have seen a screen shot
with SAP screen in webbrowser.
Please help me out if you are not clear abt my doubt please ask me for clear idea.
Thanks in advance
Phalani MHello,
Since you can't use the call transaction command in web dynpros components, I suggest you to create a report and fill a BDC table on this and use the call transaction in this report.
So, in your web dynpro component you can use a command SUBMIT to create a job in background.
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.
Regards. -
How to use Call library function node for a function in dll with VOID data type
Hi All,
I would like to ask for your kind help,
I am facing an issue with the call library node.
I have a C++ function(stdcall), which has void as data type
error code XXXX(hwnd, lID, getValue, *void data1, *void data2)
the data1 and data2 types are always changing depending upoin the value of "getValue".
Primarily i can use call library node multiple times and adapt each node according to the data types of data1 and data2, and extract the values and use in the code. Here is no issue. Real question is:
My question:
How can i just use one time call library node and make a case depending upon the "getvalue", which will control the data type of data1 and data2. Here i really looking for solutions.
My trials:
i used varaints as input to the call libray node for data1 and data2, and selected Parameters in call libraby node as " Adapt to type". here labview just crashed.
i really appreciate your feedbackand suggestions.
Thanks
Kutbuddin
Solved!
Go to Solution.
Attachments:
Clipboard02.jpg 103 KBA variant is a very specific LabVIEW datatype (really a C++ type object internally) and trying to pass that to a function, which excepts a flat memory pointer there, for sure will crash very quickly.
As to endianess, yes Unflatten will be able to adjust for endianess, which in this case however is most likely exectly NOT what you want. So make sure that the you select native type for the endianess input on Unflatten from String. LabVIEW internally works with whatever is the native endianess, as will most likely your C++ DLL. The platform independent big endian format does only come into play when you receive data streams over some streaming interface like a network connection. Here it is desirable to use an endian format that is independent from the actual platform that generates and consumes the data stream. LabVIEWs default endianes is big endian here.
But as long as you pass data directly to native components like DLLs there is no difference in endianess between what LabVIEW uses and what those components use.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
How to use call transaction 'XD03' in alv.
Hi Experts ,
Below i m write code to call transaction xd03 but it not call the transacation.
<Garbled code removed>
Moderator Message: Please continue with your previous thread. Current thread locked.
Edited by: Suhas Saha on Nov 25, 2011 5:04 PMUhm
Here it's your calling:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gv_repid
i_grid_title = gv_title
is_layout = gv_layout
it_fieldcat = gt_fielcat[]
*it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
TABLES
t_outtab = gt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
You don't indicate which is the routine for the user_command
You can do it in 2 ways:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gv_repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND' "<.------- FORM the USER_COMMAND
i_grid_title = gv_title
is_layout = gv_layout
it_fieldcat = gt_fielcat[]
*it_special_groups = gd_tabgroup
* IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
TABLES
t_outtab = gt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
Or you indicate in the GT_XEVENTS table
LS_EVENT-NAMES = 'USER_COMMAND'.
LS_EVENT-FORM = 'USER_COMMAND'. "<.------- FORM the USER_COMMAND
APPEND LS_EVENT TO GT_XEVENTS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gv_repid
i_grid_title = gv_title
is_layout = gv_layout
it_fieldcat = gt_fielcat[]
*it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
* is_variant = z_template
TABLES
t_outtab = gt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
Max -
Tracing of message in Status Bar using Call Transaction for MRBR
Hi
As per the business requirement, I would like to automate the MRBR Transaction. I am achieving this by using Call Transaction. After aaplying certain company codes as an i/p; i receive the invoices as an o/p in a ALV Lay out. Say for example, 100 invoices are displayed in a AlV Lay-out after applying i/p. Now I select all these 100 invoices and release them.
All these steps are recorded and supplied to Call Transaction via BDC table.
Problem:
The number of invoices released, appear in the status bar of that ALV Lay-out screen. This message appears on the ALV screen after I have released the invoices and clicked on "SAVE" button.I would like to use this information and display this number (No. of Invoices released) in my Job Log. But I do not know how to do it. Could any one help me out for this?
Thanks in advance,
Jigar Shah.Yes I have tried that option as well.
But the thing is, the recording gets over as soon as I click on "SAVE" button.And that message apperas in status bar only after I click on "SAVE" button.So this way the message in the status bar never gets recorded.
Thanks & Regards,
Jigar Shah. -
How we can use call transaction xd03 in alv report
hey guys i want now that how we can use call transaction xd03 in alv report by using various tables in report or coding.
can you tell me about that by the way of coding so that it can be easy for me to understand and help ful to make report by using alv report with many tables. so please send me .
Moderator message: it seems to be XD03 day today, please search for available information/documentation/previous discussions.
Edited by: Thomas Zloch on Nov 25, 2011 1:24 PMWhere?
Max -
How to create a session using call transaction method.
hi , this is nagaraju,
How to create a session using call transaction method.Hi,
About Data Transfer In R/3 System
When a company decides to implement the SAP R/3 to manage business-critical data, it usually does not start from a no-data situation. Normally, a SAP R/3 project comes into replace or complement existing application.
In the process of replacing current applications and transferring application data, two situations might occur:
The first is when application data to be replaced is transferred at once, and only once.
The second situation is to transfer data periodically from external systems to SAP and vice versa.
There is a period of time when information has to be transferred from existing application, to SAP R/3, and often this process will be repetitive.
The SAP system offers two primary methods for transferring data into SAP systems. From non-SAP systems or legacy system. These two methods are collectively called batch input or batch data communication.
1. SESSION METHOD
2. CALL TRANSACTION
3. DIRECT INPUT
First step for both the methods is to upload the data to internal table. From Internal Table, the data is transferred to database table by two ways i.e., Session method and Call transaction.
Session is intermediate step between internal table and database table. Data along with its action is stored in session i.e., data for screen fields, to which screen it is passed, the program name behind it, and how the next screen is processed.
When the program has finished generating the session, you can run the session to execute the SAP transactions in it. Unless session is processed, the data is not transferred to database table.
A technique similar to SESSION method, while batch input is a two-step procedure, Call Transaction does both steps online, one after the other. In this method, you call a transaction from your program.
SESSION METHOD
Data is not updated in database table unless Session is processed.
No sy-subrc is returned.
Error log is created for error records.
Updation in database table is always synchronous
CALL TRANSACTION
Immediate updation in database table.
Sy-subrc is returned.
Errors need to be handled explicitly
Updation in database table can be synchronous Or Asynchronous.
Regards,
Sruthi. -
Error 00-341 RAISE_EXCEPTION when using Call Transaction for VA01 in backgr
Hi,
I am getting this message when I use call transaction to create a sales order using VA01. Following is the statement I have used. Note that when i execute the program online, I am not getting any errors. I could create sales order without any problem. I am getting this exception only when I run in background.
CALL TRANSACTION 'VA01'
USING BDC_TAB
MODE 'N'
UPDATE 'S'
MESSAGES INTO W_MESS_TAB.
When I captured message tab, I got following messages.
DC006 - Control Framework: Fatal error - GUI cannot be reached
00341 Runtime error RAISE_EXCEPTION has occurred.
Please help me in this regard.
Regards
KasiSome times execution of BDC program in back ground is different from the foreground. Some screens may appear in background and raise error while same will not when executed in foreground.
Double click the message in Session log to know more details.
One way is to suppress the screen while executing BDC.
Alternatively I suggest to use BAPI instead.
- Sanjay -
Passing select-options values using call transaction method
Hi Experts,
I have a scenario in which i have three fields BUKRS,WERKS and MATKL in an internal table i_tab and I have MATNR as a selection-option.
After this I have to use call transaction <tcode> for all the line items in the internal table and the MATNR select-option values I have to pass directly for each line of i_tab using call transaction method.
TYPES: BEGIN OF t_tab,
bukrs TYPE bukrs,
werks TYPE werks_d,
matkl TYPE matkl,
END OF t_tab.
DATA: w_tab TYPE t_tab,
i_tab TYPE STANDARD TABLE OF t_tab.
SELECT-OPTIONS: s_matnr FOR marc-matnr.
Now I am putting a loop at i_tab and have to use CALL TRANSACTION <TCODE> for each line with the SELECT-OPTIONS for MATNR.
Please tell me whether we can pass multiple ranges for MATNR using call transcation method.
for example there can be multiple single values/multiple ranges/excluded ranges for MATNR. so please suggest me how tho achieve this sceanrio using CALL transaction method of BDC.
Thanks a lot.
Regards,
KrishanHi Krishan,
For the Call transaction TCODE there is extension ....OPTIONS from OPT. Just Check it out. I think it is possible like this.
... OPTIONS FROM opt
*Effect*
This addition gives you control using the values of the components of the structure opt, which must be of the Dictionary type CTU_PARAMS. The components have the following meaning:
DISMODE
Processing mode (comparable with the MODE addition)
UPDMODE
Update mode (comparable with the UPDATE addition)
CATTMODE
CATT mode (controlling a CATT procedure)
The CATT mode can have the following values:
' ' No CATT procedure active
'N' CATT procedure without single screen control
'A' CATT procedure with single screen control
DEFSIZE
Use standard window size
RACOMMIT
COMMIT WORK does not end CATT procedure
NOBINPT
No batch input mode, that s SY-BINPT = SPACE.
NOBIEND
No batch input mode after BDC data has been read
The components DEFSIZE , RACOMMIT, NOBINPT, NOBIEND always take the following values:
'X' Yes
' ' No
If the OPTIONS addition is omitted, the following settings are valid for the control parameters:
DISMODE from the MODE addition
UPDMODE
from the UPDATE addition
CATTMODE
No CATT procedure active
DEFSIZE
Do not use standard window size
RACOMMIT
COMMIT WORK ends procedure successfully
NOBINPT
Batch input mode, that is SY-BINPT =X.
NOBIEND
Batch input mode also active after BDC data has been read
Regards,
Swapna. -
Supress message in status bar when using Call Transaction
Hi,
I have designed a RF program and I am using a BDC program to call LT11 transaction for confirming TO.
As this was a Flowrack storage type we will assign Source HU during TO confirmation. So I went for a BDC.
But after confirmation I am getting a Status message TO XXX confirmed in the status bar which is also displayed in the RF Screen for every line item confirmed. I want to supress this message.
I am getting this message in the messtab table as well by using Call Transaction. So how can I supress this message in Status bar.
Please let me know for more information.
Thanks,
Manoj.>
kaka79 wrote:
> I have designed a RF program and I am using a BDC program to call LT11 transaction for confirming TO.
> But after confirmation I am getting a Status message TO XXX confirmed in the status bar which is also displayed in the RF Screen for every line item confirmed. I want to supress this message.
> I am getting this message in the messtab table as well by using Call Transaction. So how can I supress this message in Status bar.
The CTU (CALL TRANSACTION ... USING ...) captures and stores all the messages into the message internal table (... MESSAGES INTO itab ...), but they are not displayed. So, if one of them appears in the status bar, it's because there is an additional MESSAGE ... statement in the program using the CTU. So look at it and add a condition before the MESSAGE statement to not output this exact message (click the message on status bar to get the message number, or debug the program to get it from the message internal table). -
Creating PO with me21 using call transaction
hi,
I need some help regarding the application:
i have to build a custom screen having fields for creating PO using me21 transaction using call transaction.
would anybdy please guide me how to do it.
i wd appreciate ur helpHi Harpreet
For creating a custom screen you will ve to use a screen exit. For purchase order 'MM06E005' will be useful. Explore it in XN SMOD.
Regards
PRAFUL -
Updating custom table using call transaction
How to update a custom table using Call Transaction method. How can we use Table control (Module Pool) for this purpose).
Vignesh,
Create a table maintenance transaction for ur custom tables. Check this link for ref...
http://allaboutsap.blogspot.com/2007/04/table-maintenance-in-sap-step-by-step.html
And create a BDC recording and code a program accordingly...
regards,
karthik -
While uploading data into the r/3 using call transaction or session method
hi experts
while uploading data into the r/3 using call transaction or session method error occured in the middle of the processing then how these methods behaves it transfers next records or not?hai
Session method: The records are not added to the database until the session is processed. sy-subrc is not returned. Error logs are created for error records. Updation in database table is always Synchronous.
Call Transaction method: The records are immediately added to the database table. sy-subrc is returned to 0 if successful. Error logs are not created and hence the errors need to be handled explicitly. Updation in database table is either Synchronous or Asynchronous.
While to transfer the data from the through if any errors occurs until the errors are the complete the data is not transfer to the SAP system.
the system compulsory shows the errors. that errors are stored into the error logs (Transaction is SM35).
so the session method should not return any value.
In call transaction method data is directly pass to the SAP system.
So its compulsory return the value.
Because of the call transaction is the function.
A function should return the value mandatory
In session method errors stroed in SYSTEM GENRATED ERROR LOG.
IN CALL TRANSACTION TO CAPTURE THE ERRORS WE SHOULD PERFORM THE FOLLOWING.
FIRST ME MUST DECLARE AN INTERNAL TABLE WITH THE STRUCTURE OF BDCMSGCOLL TABLE.
THEN WHILE WRITING THE CALL TRANSACTION STATEMENT WE SHOULD PUT THE 'E' MODE FOR CAPTURING ALL THE ERRORS.
THEN FINALLY THE CAPTURED ERRORS MUST TO SENT TO THE INTERNAL TABLE WHICH WE DECLARED IN THE BEGINNING WITH BDCMSGCOLL BY USING THE FUNCTION MODULE "FORMAT_MESSAGE"
AND THUS THE ERROR MESSAGES WILL BE SENT TO THE INTERNAL TABLE WHICH WE DECLARED AT THE BEGINNING. -
Hi ,
This is vijay...
can anyone help me plz
Hi,
Iam uploading data using call transaction.Tcode is ff67.In this TCode we have the begining balance(ssald) and ending balance(esald).The new record we are uploading will take the begining balance as the previous record ending balance, if we give the begining balance wrong then the record does not saved it will show error(the begining balance does not match with the prior ending balance).
while uploading the data using MODE A iam able to get the desired output but by using the MODE N iam not able to get the desired output i,e if there is any error in the begining balance also the record is being saved iam not getting the error message.
Iam attaching the code below..please help me
report Z_BRS_BDC no standard page heading line-size 255.
INTERNAL TABLES DECLARATIONS
DATA : BEGIN OF bdcdata OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA : END OF bdcdata.
DATA: LV_OUT TYPE STRING.
DATA : iopt LIKE ctu_params.
DATA : wa_rec_err TYPE i.
DATA : wa_rec_wri TYPE i.
DATA : wa_tot_rec TYPE i.
DATA : amt(16) type c.
DATA : BEGIN OF gu_upload OCCURS 0,
hbkid LIKE febmka-hbkid,
hktid LIKE febmka-hktid,
aznum LIKE febmka-aznum,
azdat LIKE febmka-azdat,
ssald LIKE amt,
esald LIKE amt,
budtm LIKE febmka-budtm,
mnam1 LIKE febmka-mnam1,
jname LIKE febmka-jname,
vgman LIKE febmka-vgman,
valut LIKE febep-valut,
kwbtr(13) TYPE c,
chect_kf LIKE febmkk-chect_kf,
END OF gu_upload.
DATA:GU_DOWNLOAD LIKE GU_UPLOAD OCCURS 0 WITH HEADER LINE.
kishi*********************************
DATA: BEGIN OF itab OCCURS 0,
vgman LIKE febmka-vgman,
valut LIKE febep-valut,
kwbtr(13) TYPE c,
chect_kf LIKE febmkk-chect_kf,
END OF itab.
kishi)(_()00-8-09
DATA: BEGIN OF messtab OCCURS 0.
INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
DATA: BEGIN OF messtab1 OCCURS 0.
INCLUDE STRUCTURE messtab.
DATA: END OF messtab1.
DATA : BEGIN OF int_count OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA : END OF int_count.
DATA: c_tcode LIKE sy-tcode VALUE 'FF67',
c_upd LIKE ctu_params-updmode VALUE 'S',
c_def_size LIKE ctu_params-defsize VALUE 'X'.
*VALUES FOR STARTING COLUMNS AND ROWS IN THE EXCEL SHEET
DATA : c_begcol TYPE i VALUE '1',
c_begrow TYPE i VALUE '1',
*DATA IS ENDED AT THE 13TH COLUMN IN THE EXCELSHEET
c_endcol TYPE i VALUE '13',
*LAST ROW IN THE EXCEL SHEET
c_endrow TYPE i VALUE '65536',
c_path(3) TYPE c VALUE 'C:\'.
*Field Symbols
FIELD-SYMBOLS: <fs>.
SELECTION SCREEN PARAMETERS
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_file LIKE rlgrap-filename DEFAULT
'C:\ ',
*This is the path for downloading file
P_FNAME2 LIKE RLGRAP-FILENAME ,
c_mode LIKE ctu_params-dismode DEFAULT 'N'.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*F4 HELP FOR FILE SELECTION
PERFORM validate_input_file.
START-OF-SELECTION.
CLEAR gu_upload.
REFRESH gu_upload.
UPLOAD THE DATA FROM FLAT FILE TO INTERNAL TABLE
PERFORM file_upload.
iopt-dismode = c_mode.
iopt-updmode = c_upd.
iopt-defsize = c_def_size.
POPULATE THE DATA THROUGHSCREENS
PERFORM bdc_upload.
END-OF-SELECTION.
*DISPLY THE ERROR RECORDS
PERFORM DISPLAY-DATA.
FORM file_upload *
FORM file_upload.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = c_begcol
i_begin_row = c_begrow
i_end_col = c_endcol
i_end_row = c_endrow
TABLES
intern = int_count
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
LOOP AT int_count.
ASSIGN COMPONENT int_count-col OF STRUCTURE gu_upload TO <fs>.
IF sy-subrc NE 0.
EXIT.
ENDIF.
<fs> = int_count-value.
AT END OF row.
APPEND gu_upload.
CLEAR gu_upload.
ENDAT.
ENDLOOP.
*kishhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
LOOP AT gu_upload.
itab-vgman = gu_upload-vgman.
itab-valut = gu_upload-valut.
itab-kwbtr = gu_upload-kwbtr.
itab-chect_kf = gu_upload-chect_kf.
APPEND itab.
ENDLOOP.
*kishiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
ENDFORM. "file_upload
*& Form BDC_UPLOAD
FORM bdc_upload.
LOOP AT gu_upload.
CLEAR bdcdata.
REFRESH bdcdata.
*& POPULATE THE DATA FOR FIRST SCREEN
perform bdc_dynpro using 'SAPMF40K' '0101'.
perform bdc_field using 'BDC_CURSOR'
'FEBMKA-JNAME'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'FEBMKA-BUKRS'
'IN14'.
perform bdc_field using 'FEBMKA-HBKID'
gu_upload-hbkid.
perform bdc_field using 'FEBMKA-HKTID'
gu_upload-hktid.
perform bdc_field using 'FEBMKA-AZNUM'
gu_upload-aznum.
perform bdc_field using 'FEBMKA-AZDAT'
gu_upload-azdat.
perform bdc_field using 'FEBMKA-SSALD'
gu_upload-ssald.
perform bdc_field using 'FEBMKA-ESALD'
gu_upload-esald.
perform bdc_field using 'FEBMKA-BUDTM'
gu_upload-budtm.
perform bdc_field using 'FEBMKA-MNAM1'
gu_upload-mnam1.
perform bdc_field using 'FEBMKA-JNAME'
gu_upload-jname.
*& POPULATE THE DATA FOR SECOND SCREEN
DATA : fnam(20) TYPE c,
idx TYPE c.
MOVE 1 TO idx.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF40K' '8000'.
PERFORM bdc_field USING 'BDC_CURSOR'
'FEBMKK-CHECT_KF(03)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
CONCATENATE 'FEBMKA-VGMAN(' idx ')' INTO fnam.
PERFORM bdc_field USING fnam
itab-vgman.
CONCATENATE 'FEBEP-VALUT(' idx ')' INTO fnam.
PERFORM bdc_field USING fnam itab-valut.
CONCATENATE 'FEBMKA-KWBTR(' idx ')' INTO fnam.
PERFORM bdc_field USING fnam itab-kwbtr.
CONCATENATE 'FEBMKK-CHECT_KF(' idx ')' INTO fnam.
PERFORM bdc_field USING fnam itab-chect_kf.
idx = idx + 1.
ENDLOOP.
*perform bdc_dynpro using 'SAPMF40K' '8000'.
*perform bdc_field using 'BDC_CURSOR'
'FEBMKK-CHECT_KF(01)'.
*perform bdc_field using 'BDC_OKCODE'
'/00'.
*perform bdc_field using 'FEBMKA-VGMAN(01)'
'z001'.
*perform bdc_field using 'FEBEP-VALUT(01)'
'2007/04/26'.
*perform bdc_field using 'FEBMKA-KWBTR(01)'
' 5000-'.
*perform bdc_field using 'FEBMKK-CHECT_KF(01)'
'1122'.
perform bdc_dynpro using 'SAPMF40K' '8000'.
perform bdc_field using 'BDC_CURSOR'
'FEBMKK-CHECT_KF(01)'.
perform bdc_field using 'BDC_OKCODE'
'=SICH'.
*& POPULATE THE DATA FOR FOURTH SCREEN
perform bdc_dynpro using 'SAPMF40K' '0101'.
perform bdc_field using 'BDC_CURSOR'
'FEBMKA-BUKRS'.
perform bdc_field using 'BDC_OKCODE'
'=BUCH'.
perform bdc_field using 'FEBMKA-BUKRS'
'IN14'.
perform bdc_field using 'FEBMKA-HBKID'
gu_upload-hbkid.
perform bdc_field using 'FEBMKA-HKTID'
gu_upload-hktid.
perform bdc_field using 'FEBMKA-AZNUM'
gu_upload-aznum.
perform bdc_field using 'FEBMKA-AZDAT'
gu_upload-azdat.
perform bdc_field using 'FEBMKA-SSALD'
gu_upload-ssald.
perform bdc_field using 'FEBMKA-ESALD'
gu_upload-esald.
perform bdc_field using 'FEBMKA-BUDTM'
gu_upload-budtm.
perform bdc_field using 'FEBMKA-MNAM1'
gu_upload-mnam1.
perform bdc_field using 'FEBMKA-JNAME'
gu_upload-jname.
*perform bdc_dynpro using 'SAPMF40K' '0101'.
*perform bdc_field using 'BDC_OKCODE'
'/EENDE'.
*perform bdc_field using 'BDC_CURSOR'
'FEBMKA-BUKRS'.
perform bdc_dynpro using 'SAPMF40K' '0101'.
perform bdc_field using 'BDC_OKCODE'
'/EABBR'.
perform bdc_field using 'BDC_CURSOR'
'FEBMKA-BUKRS'.
*& USING THE CALL TRANSACTION
PERFORM call_transaction.
CLEAR BDCDATA. "<--- Add here
REFRESH BDCDATA. "<--- Add here
ENDLOOP.
ENDFORM. " BDC_UPLOAD
*& Form VALIDATE_INPUT_FILE
FORM validate_input_file.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
def_path = ' c:\ '
mask = ',.txt,.*.'
mode = 'O'
title = 'Upload '
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
IF sy-subrc <> 0 AND sy-subrc <> 3.
MESSAGE e100(zm) WITH text-007.
ENDIF.
ENDFORM. " VALIDATE_INPUT_FILE
Start new screen *
FORM bdc_dynpro USING program dynpro.
CLEAR bdcdata.
bdcdata-program = program.
bdcdata-dynpro = dynpro.
bdcdata-dynbegin = 'X'.
APPEND bdcdata.
ENDFORM. "bdc_dynpro
Insert field *
FORM bdc_field USING fnam fval.
CLEAR bdcdata.
bdcdata-fnam = fnam.
bdcdata-fval = fval.
APPEND bdcdata.
ENDFORM. "bdc_field
*& Form CALL_TRANSACTION
FORM call_transaction.
DATA: l_index LIKE sy-tabix.
CALL TRANSACTION c_tcode USING bdcdata
MODE c_mode
MESSAGES INTO messtab.
*POPULATE THE ERROR RECORDS INTO INTERNAL TABLE
IF SY-SUBRC NE 0.
GU_DOWNLOAD-HBKID = GU_UPLOAD-HBKID.
GU_DOWNLOAD-HBKID = GU_UPLOAD-HBKID.
GU_DOWNLOAD-HKTID = GU_UPLOAD-HKTID.
GU_DOWNLOAD-AZNUM = GU_UPLOAD-AZNUM.
GU_DOWNLOAD-AZDAT = GU_UPLOAD-AZDAT.
GU_DOWNLOAD-ESALD = GU_UPLOAD-ESALD.
GU_DOWNLOAD-SSALD = GU_UPLOAD-SSALD.
GU_DOWNLOAD-BUDTM = GU_UPLOAD-BUDTM.
GU_DOWNLOAD-MNAM1 = GU_UPLOAD-MNAM1.
GU_DOWNLOAD-JNAME = GU_UPLOAD-JNAME.
GU_DOWNLOAD-VGMAN = GU_UPLOAD-VGMAN.
GU_DOWNLOAD-VALUT = GU_UPLOAD-VALUT.
GU_DOWNLOAD-KWBTR = GU_UPLOAD-KWBTR.
GU_DOWNLOAD-CHECT_KF = GU_UPLOAD-CHECT_KF.
APPEND GU_DOWNLOAD.
*DISPLAY THE PROGRESS OF PROCESS
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = 'Downloading is in process'.
*DOWNLOADING THE ERROR RECORD
LV_OUT = P_FNAME2.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = LV_OUT
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = GU_DOWNLOAD.
ENDIF.
IF NOT messtab[] IS INITIAL.
PERFORM format_message.
ENDIF.
ENDFORM. " CALL_TRANSACTION
*& Form DISPLAY-DATA
FORM display-data.
SKIP.
WRITE: 'SY-SUBRC' , sy-subrc.
ENDFORM. " DISPLAY-DATA
FORM FORMAT_MESSAGE *
FORM format_message.
DATA: l_msg(100),
l_index LIKE sy-tabix.
LOOP AT messtab.
READ TABLE gu_upload INDEX l_index.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = messtab-msgid
lang = sy-langu
no = messtab-msgnr
v1 = messtab-msgv1
v2 = messtab-msgv2
v3 = messtab-msgv3
v4 = messtab-msgv4
IMPORTING
msg = l_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
WRITE:/ l_msg.
ENDLOOP.
WRITE:/ l_msg.
ENDFORM.
Message was edited by:
vijayd duvvadaHi,
First , keep the mode "E" and check the debugger , you can exactly see where the error is and let me know, what error and where it is stoping.
By your coding, i suppose to think that, its proble in the amount (currency). When ever you are try to pass the value, and value is not there in upload file or data is mismatch, the call transaction will fail in mode 'A' and succesful in mode 'N'.
In that situation use this before the currecny field.
IF NOT FEBMKA-SSALD IS INTIAL.
perform bdc_field using 'FEBMKA-ESALD'
gu_upload-esald.
ENDIF.
tHANKS
Manju
Maybe you are looking for
-
Is it possible to use a single iPhone with two contact numbers via dual sim or an app?
Is it possible to use a single iPhone with two contact numbers via dual sim or an app? This would be a useful feature for personal and company numbers but using one mobile, rather than carrying two devices or diverting calls.
-
How to get ucm doc rules according to DocProfile by using ridc
Hi experts, We need to fields of ucm docrules. I can get universal rules(all of the rules which defined in ucm) But we need relation between docprofile and rules that belonged to docprofile. As i said before, we can get docProfiles and docRules distr
-
I'm having an interesting problem with a regular text box. I'm currently editing a co workers work and have come across two paragraphs of text that do something very weird. At the right edge of inside the text box when I try to add a character (.), t
-
I purchased Beyonce's new cd but two of the videos didnt download. Please help
I purchased Beyonce's new cd but I noticed that two of the videos included didn't download. In the Itunes store for the two videos it says purchased as opposed to watch. Please help!!
-
Recursing through table / complex return types in Java Stored Functions
I have a table representing a tree with arbitrary depth, of the form: ID NUMBER(10) PRIMARY KEY, NAME VARCHAR2(20), PARENT NUMBER(10) with PARENT being a foreign key for ID, so that top-level nodes in the tree have a NULL PARENT, and other nodes have