Issue in material master update from presentation server using BAPI....
Hi Guru's...
i am trying to change the material master from presentation server (desktop flat file)
using BAPI(BAPI_MATERIAL_SAVEDATA) ....
while executing my program i am getting the message like material had changed...
but while in mm02 i am un able to fine the updates...
please find below program logic and correct me if any mistakes....
thanks in advance...
*& Report ZAREPAS36
REPORT zarepas36.
DATA : gs_bapimathead TYPE bapimathead,
gs_clientdata TYPE bapi_mara,
gs_clientdatax TYPE bapi_marax.
TYPES : BEGIN OF gty_itab1,
matnr(18),
matkl(9),
spart(2),
ntgew(13),
gewei(3),
meins(3),
END OF gty_itab1.
DATA : gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
gwa_itab1 TYPE gty_itab1.
TYPES: BEGIN OF gty_itab2,
abc(132),
END OF gty_itab2.
DATA: gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
gwa_itab2 TYPE gty_itab2.
flat file at selection screen
PARAMETERS: p_files TYPE string.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = p_files
filetype = 'ASC'
CHANGING
data_tab = gt_itab2
EXCEPTIONS
OTHERS = 8.
LOOP AT gt_itab2 INTO gwa_itab2.
IF gwa_itab2-abc(1) = 'S'.
gwa_itab1 = gwa_itab2-abc(132).
APPEND gwa_itab1 TO gt_itab1.
ENDIF.
ENDLOOP.
loop at gt_itab1 into gwa_itab1.
*Material
gs_bapimathead-material = gwa_itab1-matnr.
*Material details at client data
*material group.
gs_clientdata-matl_group = gwa_itab1-matkl.
gs_clientdatax-matl_group = 'X'.
*Division
gs_clientdata-division = gwa_itab1-spart.
gs_clientdatax-division = 'X'.
*Net Weight
gs_clientdata-net_weight = gwa_itab1-ntgew.
gs_clientdatax-net_weight = 'X'.
*Unit of Weight
gs_clientdata-unit_of_wt = gwa_itab1-gewei.
gs_clientdatax-unit_of_wt = 'X'.
*Base Unit of Measure
gs_clientdata-base_uom = gwa_itab1-meins.
gs_clientdatax-base_uom = 'X'.
endloop.
*calling BAPI for making changes in material and saving thru BAPI.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = gs_bapimathead
clientdata = gs_clientdata
clientdatax = gs_clientdatax.
IF sy-subrc NE 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
WRITE: / 'Error occured while changing material'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / 'material',gs_bapimathead-material,'changed'.
ENDIF.
hi hello Guru's
i resolved the issuee..
pleaso go thru the below proram logic for your reference..........
*& Report ZAREPAS36
REPORT zarepas36.
DATA : gs_bapimathead TYPE bapimathead,
gs_clientdata TYPE bapi_mara,
gs_clientdatax TYPE bapi_marax.
TYPES : BEGIN OF gty_itab1,
matnr(18),
matkl(9),
spart(2),
ntgew(13),
gewei(3),
meins(3),
END OF gty_itab1.
DATA : gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
gwa_itab1 TYPE gty_itab1.
TYPES: BEGIN OF gty_itab2,
abc(132),
END OF gty_itab2.
DATA: gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
gwa_itab2 TYPE gty_itab2.
DATA:ls_return TYPE bapiret2,
lt_bapiret2 TYPE standard table of bapiret2.
flat file at selection screen
PARAMETERS: p_files TYPE string.
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = p_files
filetype = 'ASC'
CHANGING
data_tab = gt_itab2
EXCEPTIONS
OTHERS = 8.
LOOP AT gt_itab2 INTO gwa_itab2.
IF gwa_itab2-abc(1) = 'S'.
gwa_itab1 = gwa_itab2-abc(132).
APPEND gwa_itab1 TO gt_itab1.
ENDIF.
ENDLOOP.
LOOP AT gt_itab1 INTO gwa_itab1.
*Material
gs_bapimathead-material = gwa_itab1-matnr.
*Material details at client data
*material group.
gs_clientdata-matl_group = gwa_itab1-matkl.
gs_clientdatax-matl_group = 'X'.
*Division
gs_clientdata-division = gwa_itab1-spart.
gs_clientdatax-division = 'X'.
*Net Weight
gs_clientdata-net_weight = gwa_itab1-ntgew.
gs_clientdatax-net_weight = 'X'.
*Unit of Weight
gs_clientdata-unit_of_wt = gwa_itab1-gewei.
gs_clientdatax-unit_of_wt = 'X'.
*Base Unit of Measure
gs_clientdata-base_uom = gwa_itab1-meins.
gs_clientdatax-base_uom = 'X'.
ENDLOOP.
*calling BAPI for making changes in material and saving thru BAPI.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = gs_bapimathead
clientdata = gs_clientdata
clientdatax = gs_clientdatax
IMPORTING
return = ls_return.
LOOP AT lt_bapiret2 INTO ls_return.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
WRITE: / 'Error occured while changing material'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
WRITE: / 'material',gs_bapimathead-material,'changed'.
ENDIF.
Similar Messages
-
Material Master: Update the Z fields using BAPI
Hi to all,
My requirement is simple. But I do not have much knowledge on BAPI. I have got some information that we can extend th BAPI and update the Z fields in material master. I have added the z fields in MARA. So when I call the bapi z fields has to get update.
Which BAPI can i use? I have got one BAPI - BAPI_MATERIAL_SAVEDATA. plz suggest me to do it.
1. how do i enhance the BAPI or extend th BAPI.
2. Is ther any approch to do it.
thnks
Yerukala SettyHi,
Append the z fields to BAPI_TE_MARA and BAPI_TE_MARAX structures using append structures.
Populate two structures for the fields in BAPI_TE_MARA and BAPI_TE_MARAX.
To BAPI_MATERIAL_SAVEDATA, under EXTENSIONIN parameters, pass structure name as BAPI_TE_MARA and Value Part1, 2, 3, 4 with the filled structure info.
Similarly append X structure as well.
Regards,
Ganga -
Material Master Update from group routing.
Dear All,
When we make material routing. in CA02>scheduling>Results--->Update material master (marking). can be done for the lead time scheduling Purpose. and update in CA96.
But when we use Group Routing, and assign multiple materials in routing header, and then go for
CA02>scheduling>Results--->** (no Material Master Update tab Appeared)
Do we have a solution for this?
Thanks & regards
RaghuDear,
Follow these steps,
Scheduling in routing (CA02 ) as :
Call up the operation overview for the routing.
Choose Extras-- Scheduling -- Schedule.
You reach the Scheduling dialog box.
Maintain the data on the dialog box. The system proposes Backward scheduling for the scheduling type.
Choose Continue.
You reach the Enter overview variant dialog box 00000001.
Enter the overview variant you want to use to display the scheduling results. Choose Continue.
The routing is scheduled. You reach the Schedule Overview screen containing the scheduling data.
After the scheduling run has been carried out, click on scheduling Result-- update material master
You use this function to update material master. Go to the CA96 and update material master.
Please try and come back.
Regards,
R.Brahmankar -
Attach document from application server using BAPI
Hi,
I am trying to attach files to Document Info Record using BAPI
BAPI_DOCUMENT_CHECKIN_REPLACE2. When i execute the z program that calls this BAPI on
presentation server in foreground by giving path of documents which are locating on local pc it works
fine and check in the file in document infor record
But when i run program in background and file path is of application server.It gives error that
Program no longer started via RFC. No return possible.
I want to know the cause of this error.
Please help.i think u need to pass Storage category = FILESYSTEM.
check the documentation of data element -
DE CV_STORAGE_CAT
but i'm not 100% sure abt it.
regards
Prabhu -
Issue: Sending material master using ALE-IDOC.
Hi all,
I am sending the material master data from one server to another.All the fields getting transported along with creator(field ERNAM) of the material.When viewed from WE05 the field is having the same data as original creator of the material in sending system.But when i view data in receiving system for field MARA-ERNAM the field is having the USER NAME giver in RFC-DESTINATION.can anybody guide so that the creator from IDOC is updated in database and not the creator given in RFC
destination.
Thank you.
Edited by: sanu debu on Jun 30, 2009 9:35 AMHi,
Hope you are using some middleware to transfer the Idoc to other system, check the mapping details from the middleware side whethere the field mapped correclty. -
File Upload and Download From Presentation server
I have a requirement to provide a selection option to user to upload a big file from presentation server.
Not sure whther we can a upload the entire file at one short from presentation server. PLease provide some sample code to upload a huge file from presentation server and downlaod a file to presentation server.Hi,
Try this code for download----
TABLES:
kna1. " General Data in Customer Master
TYPES:
BEGIN OF type_s_kna1,
kunnr TYPE kna1-kunnr, " Customer Number
adrnr TYPE kna1-adrnr, " Address
anred TYPE kna1-anred, " Title
erdat TYPE kna1-erdat, " Date on which record created
ernam TYPE kna1-ernam, " Name of Person who Created the
" Object
END OF type_s_kna1.
DATA:
fs_kna1 TYPE type_s_kna1.
DATA:
t_kna1 LIKE
STANDARD TABLE
OF fs_kna1.
" Select-options----
SELECT-OPTIONS:
s_kunnr FOR kna1-kunnr. " Customer Number
AT SELECTION-SCREEN ON s_kunnr.
SELECT kunnr " Customer number
FROM kna1
INTO s_kunnr UP TO 1 ROWS.
ENDSELECT.
IF sy-subrc NE 0.
MESSAGE 'No such customer exists' TYPE 'S'.
ENDIF. " IF SY-SUBRC NE 0
START-OF-SELECTION.
PERFORM customer_selection.
FORM customer_selection .
SELECT kunnr " Customer Number
adrnr " Address
anred " Title
erdat " Date of record creation
ernam " Person who created object
FROM kna1
INTO TABLE t_kna1
WHERE kunnr IN s_kunnr.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'C:\TEMP\CUSTOMER.TXT'
FILETYPE = 'ASC'
write_field_separator = 'X'
HEADER = '00'
WRITE_LF = 'X'
col_select = 'X'
col_select_mask = 'XXXXX'
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
IMPORTING
FILELENGTH =
TABLES
data_tab = t_kna1
EXCEPTIONS
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF. " IF SY-SUBRC NE 0
ENDFORM. " FORM CUSTOMER_SELECTION.
for upload----
" Table declarations----
TABLES:
bkpf. " Accounting Document Header
TYPES:
BEGIN OF type_s_bkpf,
bukrs TYPE bkpf-bukrs, " Company code
belnr TYPE bkpf-belnr, " Accounting Document Number
gjahr TYPE bkpf-gjahr, " Fiscal Year
blart TYPE bkpf-blart, " Document type
bldat TYPE bkpf-bldat, " Document Date in Document
END OF type_s_bkpf.
DATA:
fs_bkpf TYPE type_s_bkpf.
DATA:
fname(10) TYPE c VALUE 'ACCOUNTING' .
DATA:
t_bkpf LIKE
STANDARD TABLE
OF fs_bkpf.
*" Select-options----
SELECT-OPTIONS:
s_bukrs FOR bkpf-bukrs, " Company code
s_gjahr FOR bkpf-gjahr. " Fiscal year
OPEN DATASET fname FOR OUTPUT IN BINARY MODE .
PERFORM account_selection.
LOOP AT t_bkpf INTO fs_bkpf.
TRANSFER fs_bkpf TO fname.
ENDLOOP. " LOOP T_BKPF
CLOSE DATASET fname.
FORM account_selection .
SELECT bukrs " Company code
belnr " Accounting document number
gjahr " Fiscal year
blart " Document year
bldat " Document date
FROM bkpf
INTO TABLE t_bkpf
WHERE bukrs IN s_bukrs
AND gjahr IN s_gjahr.
ENDFORM. " FORM ACCOUNT_SELECTION
also try
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\TEMP\CUSTOMER.TXT'
FILETYPE = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = t_kna1
EXCEPTIONS
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc EQ 0.
PERFORM customer_display.
ELSE.
MESSAGE 'No customer file exists'(006) TYPE 'S'.
ENDIF. " IF SU-SUBRC EQ 0
Regards,
jaya
Edited by: Jayapradha Neeli on May 28, 2009 11:38 AM -
Return PO Price is picked up from MAP of materia master,not from info.recod
User Requirement :
When creating return po ,the price is picked up from MAP of material master ,not from info.record
I wrote a code at PO Enhancement "MM06E005" user exit "EXIT_SAPMM06E_017",but don't change the price ,pls help me check what the problem is ,thanks.
The below is my code.
DATA : M_VERPR LIKE MBEW-VERPR,
M_PEINH LIKE MBEW-PEINH,
M_MEINS LIKE MARA-MEINS.
CLEAR :M_VERPR,M_PEINH,M_MEINS.
CHECK SY-TCODE = 'ME21N ' OR SY-TCODE = 'ME22N' OR SY-TCODE = 'ME23N' .
IF I_EKKO-BSART = 'ZNB7'.
LOOP AT TEKPO.
SELECT SINGLE VERPR PEINH FROM MBEW INTO (M_VERPR,M_PEINH)
WHERE MATNR = I_EKPO-MATNR AND BWKEY = I_EKPO-WERKS.
SELECT SINGLE MEINS FROM MARA INTO M_MEINS WHERE MATNR = I_EKPO-MATNR.
TEKPO-INFNR = ' '.
TEKPO-NETPR = M_VERPR.
TEKPO-PEINH = M_PEINH.
TEKPO-MEINS = M_MEINS.
TEKPO-BPRME = M_MEINS.
TEKPO-NETPR = TEKPO-NETPR * I_EKKO-WKURS.
MODIFY TEKPO TRANSPORTING NETPR PEINH MEINS BPRME NETPR.
CLEAR TEKPO.
ENDLOOP.Hi Gunawan,
According your meaning ,I change the logic as following:
IF I_EKKO-BSART = 'ZNB7'.
SELECT SINGLE VERPR PEINH FROM MBEW INTO (M_VERPR,M_PEINH)
WHERE MATNR = I_EKPO-MATNR AND BWKEY = I_EKPO-WERKS.
SELECT SINGLE MEINS FROM MARA INTO M_MEINS WHERE MATNR = I_EKPO-MATNR.
TKOMV-KNUMH = ''.
TKOMV-KAWRT = M_VERPR * I_EKKO-WKURS.
TKOMV-KPEIN = M_PEINH.
TKOMV-KMEIN = M_MEINS.
EndIF.
But the values of the fields are not updated,I need to write the code in EXIT_SAPMM06E_017 of PO Enhancement,may you help me ,thanks. -
GUI_UPLOAD NOT READING DATA FROM PRESENTATION SERVER
H HI IN MY APPLICATION I HAVE USED GUI _UPLOAD TO READ DATA FROM PRESENTATION SERVER IT WAS WORKING FINE BUT NOW I HAVE SCHEDULED IT IN BACK BACKGROUND WHEN I DEBUGGED IT GUI _UPLOADI NOT READING DATA FROM PRESENTATION SERVER
Edited by: ravikumar1006 on Mar 10, 2012 1:18 PM
Moderator message: FAQ, please search before posting, do not write in all upper case.
Edited by: Thomas Zloch on Mar 10, 2012 3:17 PMThe issue is that, when you schedule a program as background job runs on application server not on local pc for that program use the application server resurces and its not possible to read files from pc. You can find a lot of answers in forum for this
-
Copy File from Presentation Server to Application Server in Background
Hi,
I need to copy Image file from Presentation Server to Application Server.
The below given code is workking fine in Foreground but whenevr I am trying to execute in Background, the job is cancelled and I am getting a dump.
data : wa_source type string,
wa_destination type string.
wa_source = 'C:\PARBIND.BMP'.
wa_destination = 'D:\PARBIND.BMP'.
start-of-selection.
call method cl_gui_frontend_services=>file_copy
exporting
source = wa_source
destination = wa_destination
* overwrite = SPACE
* EXCEPTIONS
* cntl_error = 1
* error_no_gui = 2
* wrong_parameter = 3
* disk_full = 4
* access_denied = 5
* file_not_found = 6
* destination_exists = 7
* unknown_error = 8
* path_not_found = 9
* disk_write_protect = 10
* drive_not_ready = 11
* not_supported_by_gui = 12
* others = 13
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
In backgound Error is....
Exception condition "CNTL_ERROR" raised.*
Any solution is appreciated.
Thanks
ArbindHi Arbind,
Just realize... when you run it in foreground, you have a foreground to capture the file location. so it runs fine..
but when you are running it in background, there is no foreground to check that is no gui present... how can it check where the C:\.... location is??
no need of reading any oss note... just see.. the name is cl_GUI_FRONTEND_service.. its only for front end..
u need open dataset, read dataset, close dataset kind of things while running in background. or RFCs to read the file... (search SDN). -
How to search file from presentation server
Hi All,
In a ABAP program i want to display a dialog box which will help me to find out any file from presentation server.That dialog box should be display after clicking on parameter on selection screen.Parameter is a simple variable,not a field from any internal table. so i can not use function module F4IF_INT_TABLE_VALUE_REQUEST
Please suggest me any function module which will satisfy my requirement.
Thank you.Hi,
Check this example..
DATA: T_FILETABLE TYPE FILETABLE.
DATA: RC TYPE I.
DATA: USER_ACTION TYPE I.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
CHANGING
file_table = T_FILETABLE
rc = RC
USER_ACTION = USER_ACTION
EXCEPTIONS
FILE_OPEN_DIALOG_FAILED = 1
CNTL_ERROR = 2
ERROR_NO_GUI = 3
others = 4
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks,
Naren -
Material Master Update through BAPI - Follow up material not updated
Hi Experts,
I am updating the material master through a custom transaction using the BAPI 'BAPI_MATERIAL_SAVEDATA'. Rest of the fields are updating correctly except for discontinuation ind., effective out date & follow-up material.
When I try to update it through MM02 it is working fine. However, when I pass the same data through BAPI it is throwing an error message that 'the material XXXXXX does not exist or is not activated'.
Please advice.
Thanks & Regards,
Ashu AroraSome more fields need to be updated along with the discont. indicator. Now working fine.
-
Read XML file from presentation server
Hi All,
I want read XML file from presentation server currently i am using GUI_UPLOAD fm . but it is reading some junk data.
DATA : BEGIN OF upl OCCURS 0,
f(255) TYPE c,
END OF upl.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = D:\XX.XML'
filetype = 'BIN'
TABLES
data_tab = upl.
is there any other alternative.
Thanks
Swarup,Hi Swarup,
Use method IMPORT_FROM_FILE of class CL_XML_DOCUMENT.
A sample code snippet :-
PARAMETERS: p_filnam TYPE localfile OBLIGATORY
DEFAULT 'C:\Documents and Settings\ssaha\Desktop\test.xml'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filnam.
DATA: l_v_fieldname TYPE dynfnam.
l_v_fieldname = p_filnam.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
field_name = l_v_fieldname
IMPORTING
file_name = p_filnam.
START-OF-SELECTION.
TYPES:
BEGIN OF ty_tab,
name TYPE string,
value TYPE string,
END OF ty_tab.
DATA:
lcl_xml_doc TYPE REF TO cl_xml_document,
v_subrc TYPE sysubrc,
v_node TYPE REF TO if_ixml_node,
v_child_node TYPE REF TO if_ixml_node,
v_root TYPE REF TO if_ixml_node,
v_iterator TYPE REF TO if_ixml_node_iterator,
v_nodemap TYPE REF TO if_ixml_named_node_map,
v_count TYPE i,
v_index TYPE i,
v_attr TYPE REF TO if_ixml_node,
v_name TYPE string,
v_prefix TYPE string,
v_value TYPE string,
v_char TYPE char2.
DATA:
itab TYPE STANDARD TABLE OF ty_tab,
wa TYPE ty_tab.
CREATE OBJECT lcl_xml_doc.
CALL METHOD lcl_xml_doc->import_from_file
EXPORTING
filename = p_filnam
RECEIVING
retcode = v_subrc.
CHECK v_subrc = 0.
v_node = lcl_xml_doc->m_document.
CHECK NOT v_node IS INITIAL.
v_iterator = v_node->create_iterator( ).
v_node = v_iterator->get_next( ).
WHILE NOT v_node IS INITIAL.
CASE v_node->get_type( ).
WHEN if_ixml_node=>co_node_element.
v_name = v_node->get_name( ).
v_nodemap = v_node->get_attributes( ).
IF NOT v_nodemap IS INITIAL
* attributes
v_count = v_nodemap->get_length( ).
DO v_count TIMES.
v_index = sy-index - 1.
v_attr = v_nodemap->get_item( v_index ).
v_name = v_attr->get_name( ).
v_prefix = v_attr->get_namespace_prefix( ).
v_value = v_attr->get_value( ).
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
* text node
v_value = v_node->get_value( ).
MOVE v_value TO v_char.
IF v_char <> cl_abap_char_utilities=>cr_lf.
wa-name = v_name.
wa-value = v_value.
APPEND wa TO itab.
CLEAR wa.
ENDIF.
ENDCASE.
* advance to next node
v_node = v_iterator->get_next( ).
ENDWHILE.
LOOP AT itab INTO wa.
ENDLOOP.
Regards
Abhii -
Guidance for getting material master data from database table
Hi,
I need guidance to fetch following Material master data from the system data base.Please guide me for the same.
BASIC DATA1
BASIC DATA2
MRP1,2,3,4
WORK SCHEDULING
QUALITY MANAGEMENT
ACCOUNTING1
ACCOUNTING2
COSTING1,2
PURCHASING
PURCHASE ORDER TEXTSALES ORG1,2
SALES GENERAL/PLANT
PLANT DATA/STOR.1,2
WAREHOUSE MGMNT1,2
Also please tell me in general what is the reason for error while uploading the data into system using BAPi(AM talking about return message error).
Thank you.
Edited by: sanu debu on Feb 24, 2009 12:41 PM
Edited by: sanu debu on Feb 24, 2009 12:42 PMUse BAPI's
BAPI_MATERIAL_GET_DETAIL
BAPI_MATERIAL_GETALL
BAPI_MATERIAL_GET_ALL -
How to get pdf file from sap presentation server using java connector
Hi Friends,
with the below code i am able to get po details in pdf in presentation server.
DATA : w_url TYPE string
VALUE 'C:\Documents and Settings\1011\Solutions\web\files\podet.pdf'.
CALL FUNCTION 'ECP_PDF_DISPLAY'
EXPORTING
purchase_order = i_ponum
IMPORTING
PDF_BYTECOUNT =
pdf = file " data in Xsting format
*Converting Xstring to binary_tab
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = file
APPEND_TO_TABLE = ' '
IMPORTING
OUTPUT_LENGTH =
TABLES
binary_tab = it_bin " data in binary format
**Downloading into PDF file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = w_url
filetype = 'BIN'
TABLES
data_tab = it_bin
when i am using java connector , to retirve the file from presentation server , the follwoing error i am getting...
init:
deps-jar:
compile-single:
run-single:
com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in Control Framework
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
at PdfGen.<init>(PdfGen.java:35)
at PdfGen.main(PdfGen.java:78)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
i debugged too, problem with <b>gui_download......</b>
I am very glad to all with your suggestions!!
Regards,
Madhu..!!Hi
You can try to create an external command (transaction SM69).......sorry I've forgotten,,,,they works on application
How do you call CL_GUI_FRONTEND_SERVICES=>EXECUTE?
Max
Edited by: max bianchi on Oct 13, 2011 10:27 AM -
Transport Master Data from one server to another server
How can I transport the master data from one server to another server?
Client copy will not be possible.
Regards,
SubhasishHi,
Look at the below link, you will understand
http://help.sap.com/saphelp_45b/helpdata/en/cc/f22c7dd435d1118b3f0060b03ca329/content.htm
Regards
Sudheer
Maybe you are looking for
-
How do you create multiple execution windows for a custom opterator interface
I am starting to create a custom operator interface for TestStand 3.5 using Labview 8.0. This is my first exposure to custom operator interfaces (and ActiveX). The example operator interfaces have only one execution window that changes based on the
-
Upgrading from OIM 10.1.2 to 10.1.4
In the OAS 10.1.4 Upgrade/Compatibility Guide, Chap 10 is called "Verifying the Upgrade and Decommissioning the Source Oracle Homes" and it says to do the following after OIM 10.1.4 upgrade from 10.1.2: 1. Move MR datafiles out of old 10.1.2 ORACLE_H
-
After installing the latest upgrade to PS Elements (13.1), the plug-in for Lightroom loads the previous version of the PSE Editor (13.0). If I load directly, I get the new 13.1 version. Applications folder shows the new 13.1 folders and the new ver
-
I have an existing email account with Hotmail, and want the pros and cons of adding icloud email to my mail accounts. I am new user (1 year) and skittish on adding available apps, turning on different options etc without knowing how that affects my e
-
Stamp Visible not allowing me to make adjustments
I'm using Photoshop CC. After using a process known as frequency separation the stamp visible layer does not allow me to use any tools to make adjustments. Is this a bug or am I doing something wrong?