Function module for assigning BP Number to the Postion ID in org model
Hi Experts,
Is there any function module for assigning BP Number to the Postion ID in organizational model.
The requirement is:
1)There are some employees which are reporting to a Manager who has a position ID.
2) Each of these employees should be assigned to the given position ID.
This can be done by First Locate the BP Record in SAP via the Vantive Person ID and retrieve the SAP BP Number.
<b>Then assign the SAP BP Number found to the Position ID.</b>
My question is <b>Is there any function module for assigning BP Number to the Postion ID .</b>
Looking forward for reply.
Thanks & Regards,
Renju.
Hi,
Org. management uses API classe objects with static methods as APIs. You may be able to achieve this using
CL_CRM_ORGMAN_SERVICES->MAPPING_ORGUNIT_TO_BP
Reward if helpful!
Regards,
Sudipta.
Similar Messages
-
Function module for getting ASCII number of the character
I need to know the ASCII number of the appropriate character. Which function module can I use? Thank you
hi,
U can use this code below
report demtest.
data : c.
field-symbols : <n> type x.
data : rn type i.
c = 'A'.
assign c to <n> casting.
move <n> to rn.
write rn.
This will convert 'A' to 65.
OR try FM LIST_TO_ASCII
Sri -
Function module for assigning a HU to delivery
Function module for assigning a HU in HU managed location to a delivery ??
Hello,
In FuGrp HU_BASIC_BAPIS Basic BAPIs for Hus
with F’tn BAPI_HU_CREATE Create handling unit with items
this creates HU's NOT yet assigned.
After F'tn BAPI_TRANSACTION_COMMIT
You can assign the HU via
F'tn BAPI_HU_CHANGE_HEADER
using the BAPIHUHEADER fields: PACK_MAT_OBJECT & PACK_MAT_OBJ_KEY.
Dirk -
Function module for assigned wage types
Hi experts,
We need wage type wise count and sum of the amount for each wage type defined in infotype '0008' for the given from and to dates. Is there any function module available for the same.
Please suggest.
Regards,
Kaustubh Kabre.Hi,
<li>I do not look for function module for this case as i know that we can or have to read wage types and corresponding amount in the program. LDB PNP should be given in program attributes.
REPORT RPABAP06.
TABLES:PERNR.
INFOTYPES:0008.
DATA: BEGIN OF WAGETYPES,
LGA LIKE P0008-LGA01,
BET LIKE P0008-BET01,
ANZ LIKE P0008-ANZ01,
EIN LIKE P0008-EIN01,
OPK LIKE P0008-OPK01,
END OF WAGETYPES.
DATA:total type P0008-BET01.
GET PERNR.
RP_PROVIDE_FROM_LAST P0008 SPACE PN-BEGDA PN-ENDDA.
DO 20 TIMES VARYING WAGETYPES-LGA FROM P0008-LGA01 NEXT P0008-LGA02
VARYING WAGETYPES-BET FROM P0008-BET01 NEXT P0008-BET02.
IF WAGETYPES-LGA IS INITIAL.
EXIT.
ELSE.
TOTAL = TOTAL + WAGETYPES-BET.
WRITE: / WAGETYPES-LGA, WAGETYPES-BET.
ENDIF.
ENDDO.
WRITE TOTAL.
Thanks
Venkat.O -
Function Module for link Change number to classification
Hello Expert.
what is the Function Module name which will link Classificaiton (tcode:cl03) to change number (cc01) .
regards
srinivasHi,
Check business object BUS1003 -
How to config Check Digits function module for Student Number Validation
Hi SLCM Experts,
In the SAP-SLCM, How to use check digits function module for validate student number. Just only config it or need to customizing program.
*Any idea to student number validation in SLCM?*
Best Regards,
Suvatchai K.Hi ,
Can you expalin it further ?
You configure the St. no in piq_matr . And set it as external or internal no. range which suits your business .
What is the validation you are looking for ?
Regards
Gajalakshmi -
Function Module for sending an Attachment
Not able to find the Function Module for sending an Attachment to the email ids.
Please help.Hi bala,
1. There is some trick involved in attachment
in the binary files.
2. I have made a program (and it works fantastic)
ONLY 6 LINES FOR EMAILING
BELIEVE ME
ITS A FANTASTIC PROGRAM.
IT WILL WORK LIKE OUTLOOK EXPRESS !
3. The user is provided with
a) file name
b) email address to send mail
and it sends ANY FILE (.xls,.pdf .xyz..)
Instantaneously !
4. Make two things first :
1. Include with the name : ZAMI_INCLFOR_MAIL
2. Report with the name : ZAM_TEMP147 (any name will do)
3. Activate both and execute (2)
4. After providing filename, email adress
5. Code for Include :
10.08.2005 Amit M - Created
Include For Mail (First Req F16)
Modification Log
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
CODE FOR PROGRAM
5.
REPORT zam_temp147 .
INCLUDE zami_inclfor_mail.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
regards,
amit m. -
Hi all,
Is there any Z function modules for OLE, which will download the data directly to Excel with 2 sheets.
Regards,
ShaliniHi Shalini Reddy
there is no FM but code is there... u can see...
*& Report YOLE_FOR_EXCEL
REPORT yole_for_excel.
*REPORT ZTEST_BYW.
OLE specific include file
INCLUDE ole2incl.
INCLUDE excel__c.
data definitions of OLE objects with type ole2_object
PARAMETERS: p_filenm(80) LOWER CASE OBLIGATORY
DEFAULT 'd:\temp\report_tsl.xls'.
DATA: g_tmp_workbook TYPE ole2_object.
DATA: g_tmp_worksheets TYPE ole2_object.
DATA: g_tmp_worksheet1 TYPE ole2_object.
DATA: g_tmp_worksheet2 TYPE ole2_object.
DATA: g_pc_template LIKE rcgfiletr-ftappl
VALUE 'd:\temp\mmr_rpt_tsl_tmp.xls'.
DATA: g_excel TYPE ole2_object.
DATA: g_workbooks TYPE ole2_object.
DATA: g_workbook TYPE ole2_object.
DATA: g_worksheets TYPE ole2_object.
DATA: g_worksheet TYPE ole2_object.
DATA: g_cell TYPE ole2_object.
DATA: g_cell1 TYPE ole2_object.
DATA: g_cell2 TYPE ole2_object.
DATA: g_cellrange TYPE ole2_object.
DATA: g_font TYPE ole2_object.
DATA: g_interior TYPE ole2_object.
DATA: g_borders TYPE ole2_object.
DATA: g_first_ws VALUE 'Y'.
DATA: g_row TYPE i.
DATA: g_col TYPE i.
definition of loop counter
DATA: i TYPE i VALUE '5'.
DATA: BEGIN OF t_sheet1 OCCURS 1,
col1(10),
col2(20),
END OF t_sheet1.
DATA: BEGIN OF t_sheet2 OCCURS 1,
col1(10),
col2(20),
END OF t_sheet2.
START-OF-SELECTION.
PERFORM prepare_data.
PERFORM download_to_excel.
END-OF-SELECTION.
call method of excel 'QUIT'.
it is now possible to leave the EXCEL application
remark: you have to go to the EXCEL application and answer the
popup dialog screen
*& Form PREPARE_DATA
FORM prepare_data.
t_sheet1-col1 = 'A1'.
t_sheet1-col2 = 'A2'.
APPEND t_sheet1.
t_sheet1-col1 = 'B1'.
t_sheet1-col2 = 'B2'.
APPEND t_sheet1.
t_sheet2-col1 = 'Y1'.
t_sheet2-col2 = 'Y2'.
APPEND t_sheet2.
t_sheet2-col1 = 'Z1'.
t_sheet2-col2 = 'Z2'.
APPEND t_sheet2.
ENDFORM. " PREPARE_DATA
*& Form DOWNLOAD_TO_EXCEL
FORM download_to_excel.
PERFORM open_excel.
PERFORM add_worksheet1.
PERFORM add_worksheet2.
PERFORM open_template_file.
PERFORM close_excel.
WRITE: / 'End of program'.
ENDFORM. " DOWNLOAD_TO_EXCEL
*& Form FILL_CELL
*& FORM routine, which fills the specified cell in the EXCEL sheet
*& with the given value
FORM fill_cell USING i_row TYPE i
i_col TYPE i
i_value
i_fontbold
i_digit
i_wraptext
i_horizon_align
i_vertical_align.
DATA: l_str TYPE string.
CALL METHOD OF g_excel 'CELLS' = g_cell
EXPORTING #1 = i_row
#2 = i_col.
SET PROPERTY OF g_cell 'VALUE' = i_value.
IF i_fontbold = 'X'.
GET PROPERTY OF g_cell 'Font' = g_font.
SET PROPERTY OF g_font 'Bold' = 1.
ENDIF.
IF NOT i_wraptext IS INITIAL.
SET PROPERTY OF g_cell 'WrapText' = 1.
ENDIF.
IF NOT i_horizon_align IS INITIAL.
IF i_horizon_align = 'L'.
SET PROPERTY OF g_cell 'HorizontalAlignment' = xlleft.
ELSEIF i_horizon_align = 'R'.
SET PROPERTY OF g_cell 'HorizontalAlignment' = xlright.
ELSEIF i_horizon_align = 'C'.
SET PROPERTY OF g_cell 'HorizontalAlignment' = xlcenter.
ENDIF.
ENDIF.
IF NOT i_vertical_align IS INITIAL.
IF i_vertical_align = 'T'.
SET PROPERTY OF g_cell 'VerticalAlignment' = xltop.
ELSEIF i_vertical_align = 'B'.
SET PROPERTY OF g_cell 'VerticalAlignment' = xlbottom.
ELSEIF i_vertical_align = 'C'.
SET PROPERTY OF g_cell 'VerticalAlignment' = xlcenter.
ENDIF.
ENDIF.
To set number format for cell
IF i_digit <> ''.
IF i_value IS INITIAL AND i_digit <> '%'.
SET PROPERTY OF g_cell 'VALUE' = ''.
ELSE.
Set number format for cell with number
IF i_digit = '1'.
SET PROPERTY OF g_cell 'NumberFormat' = '#,###.0 '.
ELSEIF i_digit = '2'.
SET PROPERTY OF g_cell 'NumberFormat' = '#,##0.00 '.
ELSEIF i_digit = '%'.
SET PROPERTY OF g_cell 'NumberFormat' = '#,##0.00% '.
ELSE.
SET PROPERTY OF g_cell 'NumberFormat' = '#,### '.
ENDIF.
ENDIF.
ENDIF.
ADD 1 TO i_col.
ENDFORM. "FILL_CELL
*& Form OPEN_EXCEL
FORM open_excel.
DATA: l_cnt TYPE i.
create object excel of OLE class 'EXCEL.APPLICATION'
CREATE OBJECT g_excel 'EXCEL.APPLICATION'.
CALL METHOD OF g_excel 'WORKBOOKS' = g_workbooks.
CALL METHOD OF g_workbooks 'ADD' = g_workbook.
GET PROPERTY OF g_workbook 'Worksheets' = g_worksheets.
GET PROPERTY OF g_excel 'ACTIVESHEET' = g_worksheet.
SET PROPERTY OF g_excel 'DISPLAYALERTS' = 0.
GET PROPERTY OF g_worksheets 'Count' = l_cnt.
l_cnt = l_cnt - 1.
Delete unwanted worksheets
DO l_cnt TIMES.
GET PROPERTY OF g_excel 'ACTIVESHEET' = g_worksheet.
CALL METHOD OF g_worksheet 'DELETE'.
ENDDO.
ENDFORM. " OPEN_EXCEL
*& Form CLOSE_EXCEL
FORM close_excel.
SET PROPERTY OF g_excel 'VISIBLE' = 1.
CALL METHOD OF g_workbook 'SAVEAS'
EXPORTING #1 = p_filenm.
quit Excel and free all OLE objects
call method of g_excel 'QUIT'.
FREE OBJECT g_interior.
FREE OBJECT g_borders.
FREE OBJECT g_font.
FREE OBJECT g_cell.
FREE OBJECT g_cell1.
FREE OBJECT g_cell2.
FREE OBJECT g_cellrange.
FREE OBJECT g_excel.
FREE OBJECT g_workbooks.
FREE OBJECT g_workbook.
FREE OBJECT g_worksheets.
FREE OBJECT g_worksheet.
ENDFORM. " CLOSE_EXCEL
*& Form ADD_WORKSHEET
FORM add_worksheet USING i_name.
Add new worksheet
IF g_first_ws <> 'N'.
g_first_ws = 'N'.
GET PROPERTY OF g_excel 'ACTIVESHEET' = g_worksheet.
ELSE.
CALL METHOD OF g_worksheets 'Add' = g_worksheet.
ENDIF.
SET PROPERTY OF g_worksheet 'NAME' = i_name.
g_row = 1.
g_col = 1.
ENDFORM. " ADD_WORKSHEET
*& Form ADD_WORKSHEET1
FORM add_worksheet1.
PERFORM add_worksheet USING 'Test 1'.
fill line in EXCEL sheet with headerlines of table columns
g_col = 1.
PERFORM fill_cell USING g_row g_col 'My First Worksheet' 'X' ''
PERFORM merge_cell USING g_row 1 g_row 4.
PERFORM set_border USING g_row 1 g_row 4 4 ''.
ADD 1 TO g_row.
g_col = 1.
PERFORM fill_cell USING g_row g_col 'ID'(001) 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col 'Name'(002) 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col 'Telephon'(003) 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col 'Rabatt'(004) 'X' '' '' '' ''.
loop at customr table and print values into EXCEL sheet
ADD 1 TO g_row.
LOOP AT t_sheet1.
g_col = 1.
PERFORM fill_cell USING g_row g_col t_sheet1-col1 '' '' '' '' ''.
PERFORM fill_cell USING g_row g_col t_sheet1-col2 '' '' '' '' ''.
ADD 1 TO g_row.
ENDLOOP.
g_col = 4.
PERFORM set_border USING 1 1 g_row g_col '' 4.
ENDFORM. " ADD_WORKSHEET1
*& Form ADD_WORKSHEET2
FORM add_worksheet2.
PERFORM add_worksheet USING 'Test 2'.
fill line in EXCEL sheet with headerlines of table columns
g_col = 1.
PERFORM fill_cell USING g_row g_col 'My Second Worksheet' 'X' ''
PERFORM merge_cell USING g_row 1 g_row 4.
PERFORM set_border USING g_row 1 g_row 4 1 'X'.
PERFORM set_color USING g_row 1 g_row 4 'LT'.
ADD 1 TO g_row.
g_col = 1.
PERFORM fill_cell USING g_row g_col 'ID'(001) 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col 'Name'(002) 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col 'Telephon'(003) 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col 'Rabatt'(004) 'X' '' '' '' ''.
loop at customr table and print values into EXCEL sheet
ADD 1 TO g_row.
LOOP AT t_sheet2.
g_col = 1.
PERFORM fill_cell USING g_row g_col t_sheet2-col1 '' '' '' '' ''.
PERFORM fill_cell USING g_row g_col t_sheet2-col2 '' '' '' '' ''.
ADD 1 TO g_row.
ENDLOOP.
g_col = 4.
PERFORM set_border USING 1 1 g_row g_col 2 'X'.
ADD 4 TO g_row.
g_col = 1.
PERFORM fill_cell USING g_row g_col 'This is a wrap text' 'X' ''
'X' 'C' 'T'.
PERFORM fill_cell USING g_row g_col 'Vertical - Bottom' 'X' ''
'' 'L' 'T'.
ADD 4 TO g_row.
g_col = 1.
PERFORM fill_cell USING g_row g_col 'Amount 1' 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col '100.04' '' 'X' '' '' ''.
ADD 1 TO g_row.
g_col = 1.
PERFORM fill_cell USING g_row g_col 'Amount 2' 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col '200.01' '' 'X' '' '' ''.
ADD 1 TO g_row.
g_col = 1.
PERFORM fill_cell USING g_row g_col 'Total' 'X' '' '' '' ''.
PERFORM fill_cell USING g_row g_col '=SUM(B13:B14)' 'X' 'X' '' '' ''.
PERFORM fill_cell USING g_row g_col '0.00' 'X' 'X' '' '' ''.
PERFORM copy_cell USING g_row 2 17 5 25 8.
ENDFORm. " ADD_WORKSHEET2
*& Form MERGE_CELL
FORM merge_cell USING i_row1 i_col1
i_row2 i_col2.
CALL METHOD OF g_excel 'Cells' = g_cell1
EXPORTING #1 = i_row1
#2 = i_col1.
CALL METHOD OF g_excel 'Cells' = g_cell2
EXPORTING #1 = i_row2
#2 = i_col2.
CALL METHOD OF g_excel 'Range' = g_cellrange
EXPORTING #1 = g_cell1
#2 = g_cell2.
CALL METHOD OF g_cellrange 'Merge'.
ENDFORM. " MERGE_CELL
*& Form SET_BORDER
FORM set_border USING i_row1 i_col1
i_row2 i_col2
i_thickness
i_allborders.
CALL METHOD OF g_excel 'Cells' = g_cell1
EXPORTING #1 = i_row1
#2 = i_col1.
CALL METHOD OF g_excel 'Cells' = g_cell2
EXPORTING #1 = i_row2
#2 = i_col2.
CALL METHOD OF g_excel 'Range' = g_cellrange
EXPORTING #1 = g_cell1
#2 = g_cell2.
IF i_allborders IS INITIAL.
CALL METHOD OF g_cellrange 'BorderAround'
EXPORTING #1 = 1 "Continuous line
#2 = i_thickness. "Thickness: 1 - Normal, 4 - Thick
ELSE.
GET PROPERTY OF g_cellrange 'Borders' = g_borders.
SET PROPERTY OF g_borders 'LineStyle' = '1'.
SET PROPERTY OF g_borders 'Weight' = i_thickness.
ENDIF.
ENDFORM. " SET_BORDER
*& Form SET_COLOR
FORM set_color USING i_row1 i_col1
i_row2 i_col2
i_color.
DATA: l_colorindex TYPE i.
CASE i_color.
WHEN 'BK'.
l_colorindex = 1. "Black
WHEN 'BR'.
l_colorindex = 53. "Brown
WHEN 'OG'.
l_colorindex = 52. "Olive Green
WHEN 'DG'.
l_colorindex = 51. "Dark Green
WHEN 'DT'.
l_colorindex = 49. "Dark Teal
WHEN 'DB'.
l_colorindex = 11. "Dark Blue
WHEN 'ID'.
l_colorindex = 55. "Indigo
WHEN 'G4'.
l_colorindex = 56. "Gray 80%
WHEN 'DR'.
l_colorindex = 9. "Dark Red
WHEN 'OR'.
l_colorindex = 46. "Orange
WHEN 'DY'.
l_colorindex = 12. "Dark Yellow
WHEN 'GR'.
l_colorindex = 10. "Green
WHEN 'TL'.
l_colorindex = 14. "Teal
WHEN 'BL'.
l_colorindex = 5. "Blue
WHEN 'BY'.
l_colorindex = 47. "Blue Gray
WHEN 'G3'.
l_colorindex = 16. "Gray 50%
WHEN 'RD'.
l_colorindex = 3. "Red
WHEN 'LO'.
l_colorindex = 45. "Light Orange
WHEN 'LI'.
l_colorindex = 43. "Lime
WHEN 'SG'.
l_colorindex = 50. "Sea Green
WHEN 'AQ'.
l_colorindex = 42. "Aqua
WHEN 'LB'.
l_colorindex = 41. "Light Blue
WHEN 'VL'.
l_colorindex = 13. "Violet
WHEN 'G2'.
l_colorindex = 48. "Gray 40%
WHEN 'PK'.
l_colorindex = 7. "Pink
WHEN 'GD'.
l_colorindex = 44. "Gold
WHEN 'YL'.
l_colorindex = 6. "Yellow
WHEN 'BG'.
l_colorindex = 4. "Bright Green
WHEN 'TQ'.
l_colorindex = 8. "Turquoise
WHEN 'SB'.
l_colorindex = 33. "Sky Blue
WHEN 'PL'.
l_colorindex = 54. "Plum
WHEN 'G1'.
l_colorindex = 15. "Gray 25%
WHEN 'RS'.
l_colorindex = 38. "Rose
WHEN 'TN'.
l_colorindex = 40. "Tan
WHEN 'LY'.
l_colorindex = 36. "Light Yellow
WHEN 'LG'.
l_colorindex = 35. "Light Green
WHEN 'LT'.
l_colorindex = 34. "Light Turquoise
WHEN 'PB'.
l_colorindex = 37. "Pale Blue
WHEN 'LV'.
l_colorindex = 39. "Lavender
WHEN 'WH'.
l_colorindex = 2. "White
WHEN OTHERS.
l_colorindex = 2. "White
ENDCASE.
CALL METHOD OF g_excel 'Cells' = g_cell1
EXPORTING #1 = i_row1
#2 = i_col1.
CALL METHOD OF g_excel 'Cells' = g_cell2
EXPORTING #1 = i_row2
#2 = i_col2.
CALL METHOD OF g_excel 'Range' = g_cellrange
EXPORTING #1 = g_cell1
#2 = g_cell2.
GET PROPERTY OF g_cellrange 'Interior' = g_interior.
SET PROPERTY OF g_interior 'ColorIndex' = l_colorindex.
ENDFORM. " SET_COLOR
*& Form COPY_CELL
FORM copy_cell USING i_crow i_ccol
i_prow1 i_pcol1
i_prow2 i_pcol2.
CALL METHOD OF g_excel 'Cells' = g_cell
EXPORTING #1 = i_crow
#2 = i_ccol.
CALL METHOD OF g_cell 'Copy'.
CALL METHOD OF g_excel 'Cells' = g_cell1
EXPORTING #1 = i_prow1
#2 = i_pcol1.
CALL METHOD OF g_excel 'Cells' = g_cell2
EXPORTING #1 = i_prow2
#2 = i_pcol2.
CALL METHOD OF g_excel 'Range' = g_cellrange
EXPORTING #1 = g_cell1
#2 = g_cell2.
CALL METHOD OF g_worksheet 'Paste'
EXPORTING #1 = g_cellrange.
ENDFORM. " COPY_CELL
*& Form OPEN_TEMPLATE_FILE
FORM open_template_file.
CALL METHOD OF g_workbooks 'Open' = g_tmp_workbook
EXPORTING #1 = g_pc_template
#2 = 2
#3 = 0
#4 = 1
#5 = 0
#6 = 0
#7 = 1.
CALL FUNCTION 'FLUSH'
EXCEPTIONS
OTHERS = 0.
GET PROPERTY OF g_tmp_workbook 'Worksheets' = g_tmp_worksheets.
GET PROPERTY OF g_tmp_worksheets 'Item' = g_tmp_worksheet1
exporting #1 = 1.
GET PROPERTY OF g_tmp_worksheets 'Item' = g_tmp_worksheet2
exporting #1 = 2.
CALL METHOD OF g_tmp_worksheet1 'Copy'
EXPORTING #1 = g_worksheet.
CALL METHOD OF g_tmp_worksheet2 'Copy'
EXPORTING #1 = g_worksheet.
call method of g_tmp_workbook 'Close'.
CALL FUNCTION 'FLUSH'
EXCEPTIONS
OTHERS = 0.
ENDFORM. " OPEN_TEMPLATE_FILE -
Function Module for creation of variant in BADI
I need to create a variant to store shipment no's which are coming in BADI. And variant need to be passed to a report which has to be run Background. can anyone help me out how to do it. Can anyone know the function module for this.
Hi Anirban,
Use the bapi BAPI_BUSPROCESSND_CREATEMULTI to achieve the same.
<b>Reward points if it helps.</b>
Regards,
Amit Mishra -
Function Modules for indirect values
What are the function modules for indirect values?
Hi,
The SAP function module for indirect valuation of wages is RP_FILL_WAGE_TYPE_TABLE_EXT.
Also, if indirect valuation is being used, the annual salary field ANSAL also may not be populated. Again, there are some SAP function modules to help us out:
RP_ANSAL_FROM_PERNR - Use this one if all you have is PERNR
RP_ANSAL_FROM_INFOTYPE - Good if you have already data for infotypes 0001 & 0008
RP_ANSAL_FROM_WAGETYPES - It requires a list of wage types used in 8 .
by
Prasad gvk. -
Any Function module for Date conversion
Hi,
In my output the date is coming like 80999898 but the actual date is 01.01.1900.
Could you please tell me is there any Function module for that.
Regards,
TusharUse the conv. exit CONVERSION_EXIT_INVDT_OUTPUT for this purpose.
BR,
Suhas -
How to create the INBOUND Function Module for INBOUND IDOCs
Hi Friends,
Can any Suggest me How to proceed to Create an INBOUND Function Module for Processing the INBOUND IDOCS
which are recieved from XI Server ?
I am working in SAP-ISU
Here i will recieve the INBOUND IDOCs for the Meter Reading Orders.
We have a Standard INBOUND FUNCTION MODULE
IDOC_INPUT_ISU_MR_UPLOAD
which Uploads the Meter Reading Results.
I copied the Same function Module into ZIDOC_INPUT_
and working on it.
Can any one suggest me, whether i am going in correct way or not.
In IDOC_INPUT_ISU_MR_UPLOAD Inbound fun module,
BAPI_MTRREADDOC_UPLOAD is used to Update or Insert the Meter Reading Results,
My requirment is to Insert and Update the Meter Reading Orders which are Inbounded from XI.
Can I Use the Same BAPI
BAPI_MTRREADDOC_UPLOAD
to Update the below fields,
EABL-SERNR
EABL-ZWNUMMER
EABLG-ABLESGR
EABL-V_ZWSTAND
EABL-N_ZWSTAND
EABL-ABLHINW
EABL-ZSKIPC
EABL-ADAT
EABL-ATIMTATS
EABL-ADATTATS
EABL-ATIM
EABL-ZMESSAGE
EABL-ABLESER(Meter reader number)
Kindly Suggest me,
Thanks in Advance,
GaneshHello Ganesh
I think you are going completely astray with you z-function module for IDoc processing.
If you look at TABLES parameter METERREADINGRESULTS (type BAPIEABLU ) of BAPI_MTRREADDOC_UPLOAD you will find many of the requested fields already:
EABL-SERNR => BAPIEABLU-SERIALNO
EABL-ZWNUMMER =>REGISTER
EABLG-ABLESGR
EABL-V_ZWSTAND
EABL-N_ZWSTAND
EABL-ABLHINW
EABL-ZSKIPC
EABL-ADAT
EABL-ATIMTATS => ACTUALMRTIME
EABL-ADATTATS => ACTUALMRDATE
EABL-ATIM
EABL-ZMESSAGE
EABL-ABLESER(Meter reader number)
Field EABL-ZMESSAGE appears to be custom field (at least I cannot find it on ECC 6.0). If this field was added using include CI_EABL then you probably can get these values into the BAPI using the EXTENSIONIN parameter.
Check routine CHECK_UPLOADRECORDS in the BAPI which allows two extension structures:
- BAPI_TE_EABL
- BAPI_TE_EOSB
Not surprisingly BAPI_TE_EABL contains the include CI_EABL.
Regards
Uwe -
Creation of function module for updating the ztable
Hi,
I am sending the requirement for ceation of function module for updating the ztable.
Requirement----
Table Updation rule (New record)
While creating a new record the calling function will export the following to the table handling function.
Table field Probable Values
ZORDERNO-------> Sales Delivery no in case of sales orderShipment no in case of transfer order
UNAME----
> User ID
ZORDTYPE----
> SALEOR in case of sales orderTRANSF in case of transfer order
ZREFDOCNO----
>Sales Order no in case of sales orderPurchase Order no in case of transfer order
ZREFDOCNO1----
>Delivery no in case of transfer order
The table handling function will calculate the following fields
Table field Probable Values
ZREQNO----
>Running serial number (incremented by 1 for each new record)
ZREQDAT -
>System date
ZREQTIME----
> System time
ZSTATUS----
>OPEN (for all new records)
Before inserting a new record the table handling function will always check if a previous record exists for the same order / shipment no. if record exists the function will not insert a new record.
Table Updation rule (Status Update)
While updating a record the calling function will export the following to the table handling function.
Table field Probable Values
ZORDERNO----
>Sales order no in case of sales orderShipment no in case of transfer order
ZSTATUS----
>CANCEL if cancellation successfulERROR if cancellation not possible (order already processed)
The table handling function will calculate the following fields
Table field Probable Values
ZSTATDAT----
>System date
ZSTATTIME----
> System timeDo you have to create/update new record in Ztable through Function Module ?
or you need to write FM only for validation?
Any how, you need to create a Program with Input values for the fields of Ztable, and for rest of fields the Value can be calculated based on input as per your requirement.
Let me know clearly what exactly u need ?
Regards,
Kiran -
Function Modul for Order Number from VA02
Hallo
i have a delivery number and want read the order number from VA02.
Of course, select the database from LIKP --> LIPS --> VBKD is possible but
maybe it has function modul for read the order number from transaction VA02.
THX ANUHi,
I think is better recover the data directly from DB tables (in table LIPS you have the fields VGBEL, VGPOS, VGTYP ) if you only want the order number.
With the delivery number you only need to acces 1 table. If you use a FM, you will recover this data and a few fields that is not interesting for you. The access to table LIPS is using table index (delivery number)
Regards,
Pepe -
Variables passed to Function module for posting the Idoc
Hi,
For Posting the Inbound Idoc a Function module is created what should be the values passed to
1) return_variable and
2) workflow_result.
I saw in many of the program like this if there is an error in posting.
I gave return_variable-wf_param = ' Error Idoc'.
and workflow_result = '99999'.
Why are these values passed, where are they used.Josephine,
In your parntner profile for your customer/vendor ( depending on your idoc type and business scenario) , you would have assigned the post processing permitted agent.
In case the function module errors out, these values are carried out to the WF container and appropriate post processing notifications are sent to the agents. That is the purpose of having these variables in here.
It could be a success/failure, agents are notified in either case.
Ganesh
Maybe you are looking for
-
Receive attachment using Custom Document
Hi , I have done integration with an external service where in response , they send me a gz attachment. I am not able to read it. I want to read it using callout and den process it.Also in below mail trail, you can see my callout code. Protocol Trans
-
I am trying to set up the Master Repository with the MS SQL Server 2005 JDBC Driver. I copied the sqljdbc.jar file into the /drivers directory, but it is not appearing in the drop down list. Any ideas? Thanks in advance. EDIT: I have solved the probl
-
Everytime when i try to download the free trial from the CC it says error i dont have permission so is there a link to download the free trial without the CC?
-
Internal Sub-Contracting Scenario
Hai Friends, Please explain me the scenario of internal sub-contracting process. What is the settings required in SAP ?
-
Can't find AIRes.dll when updating AI CS6 to 16.0.5
I get the following message when I try to update AI CS6 ver. 16.0.3 to 16.0.5: "Can't find AIRes.dll. Please re-install the application" I uninsatlled and reinstalled and changed permission to admin. Restarted computer and still get message. Win 8.1