How to give the date to the funtction module
Hi.
i want to pass a date from the eban-badat to the function module and the output will be based on this date.
the requirement is like
if the po date .i.e eban-badat is 25th nov 08..then the output b_date should be 1st of november 2008.
that means i want to have the month and year to be same but the date will always be 1st of that month.
please tell me how to do it.
i m doing like:
b_date = it_eban-badat+6(2) .
b_date+4(2) = '01'.
but dont know whether it will work or not.
please explain the correect code.
thanks!
Hi Tanisha,
You just pass the value of the date to your variable that by using the offset function you can set the date to the first of the month. For example
b_date = it_eban-badat.
b_date+6(2) = '01'.
assuming that the date in eban-badat is 25th nov 2008, which is stored internally as 20081125.
With the above code, b_date = '20081125'. and when you write b_date+6(2) = '01' the new value in b_date = '20081101' which signifies the 1st of the month.
Regards,
Sachin Dargan.
Similar Messages
-
How to give constant data in RFC function module
Hello;
I have created a BAPI which doesnt have any data i want to put some data in that BAPI so tried with constants but it is not working..how put hard code data in function module..when i put the data it gives error stating that 'Function-Pool' should not be the first statement..
Thanks and Regards,
Om.HI;
Ya I did it but still i am facing the same problem...can u just tel me is this right
DATA: Total TYPE p DECIMALS 3.
CONSTANTS: BEGIN OF sampledata,
CARRID TYPE c LENGTH 5 VALUE 'AA',
SEATSMAX TYPE i value '600',
SEATSOCC TYPE i value '500'.
CONSTANTS end OF sampledata.
Export
CARRID = 'AA'
CURRENCY = 'USD'
SEATSMAX = '600'
SEATSOCC = '500'
Total = 100 * ( seatsocc / seatsmax ). -
How to give the length , cardinality and format when creatin a data type?
Hi,
I am new to XI and i wish to know how to give the cardinality ,format and length when creating a data type .Also please let me know how to give the following?
cardinality --repeating and required
non repeating , optional
thanks and regardsWhen you are defining the elements of the datatype there are columns where you can do what you need:
<b>column type</b>: here you choose the type of data of the element
it can be a standard type or a user defined one (if you click one time only it should appear an icon in the right for input help: click there and choose the type you need)
<b>column occurence </b>: in a similar way of column type here you define the cardinality of the element (min occurence and max occurence)
setting min occurrence: 1, max occurrence 1 or unbounded --> required
mmin occurrence 0, max occurrence 0, 1 or unbounded --> optional
about the attributes there are directly the choice between required or optional.
<b> column details </b>: here you define the length of the element if it is a string or a lot of other things if the type is a different one.
I hope this will help you -
In BSP how to give the input field as mandatory?
Hi friends,
In BSP how to give the input field as mandatory?
In BSP i want to validate the input field (example checking the material no is valid or not)
if this material no doesnot exit means i want to pass error message.What is the code for that.
Moosahi
try this
in LAYOUT
<htmlb:inputField id = "vname" disabled = "False" value = "<%= v_visitor %>"/> <font color="red" size="2"><b><%= page->messages->assert_message( 'vname' ) %></b></font></td>
in DO_HANDLE_EVENT
in oninputprocessing
CLASS CL_HTMLB_MANAGER DEFINITION LOAD.
IF event_id = CL_HTMLB_MANAGER=>EVENT_ID.
DATA: event TYPE REF TO CL_HTMLB_EVENT.
event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).
IF event->name = 'button' AND event->event_type = 'click'.
DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.
button_event ?= event.
ENDIF.
case event->id.
when 'select'.
if v_visitor = ''.
page->messages->add_message(
condition = 'vname'
message = 'Visitor Name can not be blank'
severity = page->messages->CO_SEVERITY_ERROR ).
ELSE.
here u can write ur when ur field getting filled
endif.
endcase.
endif.
give marks if it is helpful
thanks -
How to give the reference to the path to copy the file to the server?
hi all
i am developing a page in jsp , in which i will open tiff image or autocad drawing,
i get a file from one CMS, through JSP i login into CMS and get the file reference, till that i am successfull.
but after that to open a file i have to copy that file into local pc or to the server(where my jsp page runs) and then try to open it.
could any one know how to give the reference to the path if i have to copy the file to the server or my Local PC from CMS.
Regards
Oersla Afroze Ahmedhi Deepu,
Use FM '/SAPDMC/LSM_F4_FRONTEND_FILE' for fetching the data from the application server path/presentation server path
Regards,
Santosh -
How to give the no of lines per a page in alv report
hi
could u plz inform me
how to give the no of lines per page in alv report
in ordinary report we can give line-count na
how can we give in alvs.
thanx
kals.Hi Kalyan,
There is another Forum(Abap Development) where u can post abap related stuffs and u can also get quick answers there..
Cheers...
Santosh -
How to give the points??
hi all
pls let me tell how to give the point to our friends??please check the rules engagement found in the begining of the questions page. Out of that the 4 th step is the following.
Step 4: Thank Others by Giving Points
SDN/BPX has a Contributor Recognition Program. Which in short text means that for each question you have 10 points, which can be given to the person that answers your question. 6 & 2 points should also be given for helpful answers. For every question you later award points for, you in turn receive 1 point for.
you would find three radio buttons on the left hand side of your query with marked with 3 colors. Choose the suitable one based on the merit of the answer.
regards
sadhu kishore -
Hi,
i want to know how to give the connectivity
from mat. doc. no.(MBLNR) to sales invoice no(VBELN).
CAN ANYONE GIVE ME THE FLOW OF THAT
ThanksHi
You can MSEG-VBELN with VBAK-VBELN
Regards
Shiva -
How to give the CTS of a SE78 object?
How to give the CTS of a SE78 object? When we import a BMP file from PC via SE78 then how can I give it the CTS number?
Regards,
SubhasishYou have an option in SE78 menu, Graphic -- > transport( shift+F6).
-
Hi gurur's how we give the validations to the table
hi gurur's how we give the validations to the table. plz help me
Hi Sri...
Please clarify your requirement.
If you want to put some validation in a Z table,you can put your code in Table Maintenance Genereators Events.
Go to SE11 --> Utilities --> Table Maintenance Generator --> Environment -->Modification --> Event
Choose the Event and Put your code in corresponding routine.
Hope this help.
Reagrds,
Piyush Mathur
Rewards Points, if helps -
How to use the text module in script
hi,
i script how to use the text modules and how to write the code in layout of the script?Hi,
You canr use text modules in script. You have to use standard texts .
Standard text are maintained in SO10 transaction.
you can create translation text for other languages also . So based on logon language it will print translation text.
go to SO10
give textname it say Ztextname id as ST and language as EN
say create, then you will get editor there maintain your text and save it . then come back . Now change language (say for german DE) say create and eneter translation text and save it.
so now you have created a text called ztextname which you can use in your script.
Inorder to insert the texts in your script do as below
go to any window editor and select path
Insert->texts->symbols->standard symbols
then you will get popup in which you have to mention all the parameters that you have created earlier.
after inserting just change language EN to sy-langu
Reward points if useful
About text elements Sravan already given some informatiomn
Regards,
Nageswar -
How to use the function module ....
hi
how to use the function module ssf_function_module_name in smartformsHi..
If you are using this Function module, you can get the generated function module name of smartform dynamically. It is good progrmaming practice to get the fucntion module name dynamically because there might be some problems if you are hard coding in program.
This will return the name of the function module and then from the exporting parameters you can use the fucntion module name to pass parameters to Smartforms.
Check this link.I am expalining here how to use this function module.
https://wiki.sdn.sap.com/wiki/pages/pointstab/viewpageversion.action?pageId=36109&version=2
Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
<b>Reward points if useful</b>
Regards
Ashu -
How to use the function module /IRM/IPBB_AGREEMENT_CREATE.
Hi all,
Please help me how to use the function module /IRM/IPBB_AGREEMENT_CREATE.
It is a Vistex fuction module which is used to create Sales contract in SAP-Vistex. If anyone has use the function module and do have the sample code please share it.
Thanks.FORM create_agreement TABLES pt_agreement
CHANGING po_agreement .
CONSTANTS: c_strt_knumh TYPE knumh VALUE '0000000000'.
DATA: lc_kona TYPE /irm/s_gkona,
lc_cbasp TYPE /irm/s_ipcbasp,
lt_cbapr TYPE /irm/t_ipcbapr, "Partners
lc_cbapr TYPE /irm/s_ipcbapr,
lt_cbadt TYPE /irm/t_ipcbadt, "Dates
lc_cbadt TYPE /irm/s_ipcbadt,
lt_cbafs TYPE /irm/t_ipcbafs,
lc_cbafs TYPE /irm/s_ipcbafs,
lt_cbacn TYPE /irm/t_ipcbacn,
lc_cbacn TYPE /irm/s_ipcbacn,
lt_cbacl TYPE /irm/t_ipcbacl,
lc_cbacl TYPE /irm/s_ipcbacl,
lt_cbtpv TYPE /irm/t_ipagtpv,
lc_cbtpv TYPE /irm/s_ipagtpv,
lt_texts TYPE text_lh,
lc_texts TYPE itclh,
lt_cbasd TYPE /irm/t_ipcbasd,
lc_cbasd TYPE /irm/s_ipcbasd,
lc_agreement TYPE /irm/s_ipcbasp_doc,
lc_e_log_number TYPE balognr,
lt_messages TYPE /irm/t_gprolog.
DATA: lt_vake TYPE cond_vakevb_t,
lc_vake TYPE LINE OF cond_vakevb_t,
lt_konh TYPE /irm/t_gkonh,
lc_konh TYPE LINE OF /irm/t_gkonh,
lt_konp TYPE /irm/t_gkonp,
lc_konp TYPE LINE OF /irm/t_gkonp,
lt_konw TYPE /irm/t_gkonwu,
lc_konw TYPE LINE OF /irm/t_gkonwu,
lt_konm TYPE /irm/t_gkonmu,
lc_konm TYPE LINE OF /irm/t_gkonmu,
lt_komg TYPE /irm/t_gkomg_index,
lc_komg TYPE LINE OF /irm/t_gkomg_index,
lt_user_data TYPE /irm/t_gpraxfu_index,
lc_user_data TYPE LINE OF /irm/t_gpraxfu_index.
DATA: lc_updt(1) TYPE c.
DATA: lc_knumh TYPE knumh.
DATA: BEGIN OF lc_str_knumh,
hd(2) TYPE c VALUE '$$',
inc_num(8) TYPE c,
END OF lc_str_knumh.
DATA: blank_agree_key TYPE knuma VALUE '~~~~~~~~~~'.
FIELD-SYMBOLS <konh_line> LIKE LINE OF lt_konh.
FIELD-SYMBOLS <konp_line> LIKE LINE OF lt_konp.
DATA: lc_rule TYPE type_key_rule.
READ TABLE pt_agreement INTO lc_rule INDEX 1.
SELECT SINGLE * FROM kona
WHERE vkorg = lc_rule-vkorg
AND vtweg = '10'
AND spart = '10'
AND boart = 'ZPS1'
AND botext = lc_rule-sap_agkey.
IF sy-subrc = 0.
lc_updt = 'U'.
ELSE.
lc_updt = 'I'.
ENDIF.
LOOP AT pt_agreement INTO lc_rule.
MOVE sy-tabix TO lc_str_knumh-inc_num.
CONDENSE lc_str_knumh-inc_num NO-GAPS.
WHILE lc_str_knumh-inc_num+7(1) = ' '.
CONCATENATE '0' lc_str_knumh-inc_num INTO lc_str_knumh-inc_num.
CONDENSE lc_str_knumh-inc_num NO-GAPS.
ENDWHILE.
CONCATENATE '$$' lc_knumh INTO lc_knumh.
MOVE lc_str_knumh TO lc_knumh.
MOVE c_strt_knumh TO lc_knumh.
CLEAR: lc_konh, lc_konp, lc_komg.
MOVE: lc_rule-vkorg TO lc_komg-komg-vkorg,
'10' TO lc_komg-komg-vtweg,
'10' TO lc_komg-komg-spart,
p_waers TO lc_komg-komg-waerk,
'1300' TO lc_komg-komg-bukrs,
lc_rule-lifnr TO lc_komg-komg-lifnr,
lc_knumh TO lc_komg-knumh,
lc_knumh TO lc_konh-knumh,
lc_knumh TO lc_konp-knumh,
lc_rule-datab TO lc_konh-datab,
lc_rule-datbi TO lc_konh-datbi.
CASE lc_rule-tablnam.
WHEN 'A701'. "Every Agreement will have a A701 rule -
"Therefore we acn setup the header using A701
MOVE: 'New ' TO lc_kona-knuma,
lc_rule-vkorg TO lc_kona-vkorg,
'10' TO lc_kona-vtweg,
'10' TO lc_kona-spart,
'ZPS1' TO lc_kona-boart,
'C' TO lc_kona-abtyp,
'V' TO lc_kona-kappl,
p_waers TO lc_kona-waers,
lc_rule-knuma_ag TO lc_kona-abrex,
'ZPS2' TO lc_kona-kobog,
lc_rule-datab TO lc_kona-datab,
lc_rule-datbi TO lc_kona-datbi,
lc_rule-sap_agkey TO lc_kona-botext,
'1300' TO lc_kona-bukrs,
'I' TO lc_kona-updkz.
MOVE: 'New ' TO lc_cbasp-knuma_ag,
'ZPS1' TO lc_cbasp-boart_ag,
p_waers TO lc_cbasp-waers,
'A' TO lc_cbasp-setl_mth,
'B' TO lc_cbasp-setl_typ,
'A2' TO lc_cbasp-ident,
'E' TO lc_cbasp-setlm,
'ZPDA' TO lc_cbasp-pargr,
'X' TO lc_cbasp-npric,
'LF' TO lc_cbasp-stprl,
lc_rule-lifnr TO lc_cbasp-stpar,
lc_rule-contract_rev TO lc_cbasp-rvnum,
'I' TO lc_cbasp-updkz.
CONCATENATE: blank_agree_key
lc_rule-lifnr INTO lc_konh-vakey.
MOVE: lc_rule-lifnr TO lc_konp-lifnr.
WHEN 'A703'.
CONCATENATE: blank_agree_key
lc_rule-kunnr INTO lc_konh-vakey.
MOVE lc_rule-kunnr TO lc_komg-komg-kunnr.
WHEN 'A709'.
CONCATENATE: blank_agree_key
lc_rule-zzprodh1 lc_rule-zzprodh2 lc_rule-zzprodh3
lc_rule-zzprodh4 lc_rule-zzprodh5 INTO lc_konh-vakey.
CONCATENATE: lc_rule-zzprodh1 lc_rule-zzprodh2 lc_rule-zzprodh3
lc_rule-zzprodh4 lc_rule-zzprodh5 INTO lc_komg-komg-prodh.
WHEN 'A710'.
CONCATENATE: blank_agree_key
lc_rule-matkl INTO lc_konh-vakey.
MOVE lc_rule-matkl TO lc_komg-komg-matkl.
WHEN 'A711'.
CONCATENATE: blank_agree_key
lc_rule-matnr INTO lc_konh-vakey.
MOVE lc_rule-matnr TO lc_komg-komg-matnr.
IF lc_rule-kschl = 'ZPPL'.
MOVE: 'C' TO lc_konp-krech,
'CAD' TO lc_konp-konwa.
lc_konp-kbetr = lc_rule-net_po_price * 1.
ENDIF.
WHEN 'A717'.
WHEN 'A718'.
CONCATENATE: blank_agree_key
lc_rule-zzextwg INTO lc_konh-vakey.
MOVE lc_rule-zzextwg TO lc_komg-komg-zzextwg.
WHEN 'A719'.
CONCATENATE: blank_agree_key
lc_rule-werks INTO lc_konh-vakey.
MOVE lc_rule-werks TO lc_komg-komg-werks.
WHEN 'A721'.
CONCATENATE: blank_agree_key
lc_rule-kunnr lc_rule-werks INTO lc_konh-vakey.
MOVE: lc_rule-kunnr TO lc_konp-kunnr,
lc_rule-kunnr TO lc_komg-komg-kunnr.
WHEN 'A722'.
CONCATENATE: blank_agree_key
lc_rule-vkbur INTO lc_konh-vakey.
MOVE lc_rule-vkbur TO lc_komg-komg-vkbur.
WHEN 'A724'.
CONCATENATE: blank_agree_key
lc_rule-kunnr lc_rule-vkbur INTO lc_konh-vakey.
MOVE: lc_rule-kunnr TO lc_konp-kunnr,
lc_rule-kunnr TO lc_komg-komg-kunnr,
lc_rule-vkbur TO lc_komg-komg-vkbur.
ENDCASE.
MOVE: 'A' TO lc_konh-kvewe,
lc_rule-tablnam+1(3) TO lc_konh-kotabnr,
lc_rule-kappl TO lc_konh-kappl,
lc_rule-kschl TO lc_konh-kschl.
REPLACE ALL OCCURRENCES OF '~' IN lc_konh-vakey WITH ' '.
APPEND lc_konh TO lt_konh.
CLEAR lc_konh.
*--- Add in the KONP.Do we need to add
MOVE: lc_rule-kappl TO lc_konp-kappl,
lc_rule-kschl TO lc_konp-kschl,
'G' TO lc_konp-krech.
IF lc_rule-kschl+3(1) = '%'.
MOVE: 'A' TO lc_konp-krech,
'%' TO lc_konp-konwa.
lc_konp-kbetr = lc_rule-rebate_perc * 1.
ENDIF.
APPEND lc_konp TO lt_konp. CLEAR lc_konp.
APPEND lc_komg TO lt_komg. CLEAR lc_komg.
ENDLOOP.
IF lc_updt = 'I'.
CALL FUNCTION '/IRM/IPCB_AGREEMENT_CREATE'
EXPORTING
I_MESSAGES_DISPLAY = ' '
I_SAVE_MESSAGES = ' '
I_COMMIT_WORK = 'X'
I_CALL_FROM_WS = ' '
is_kona = lc_kona
is_cbasp = lc_cbasp
it_cbapr = lt_cbapr
it_cbadt = lt_cbadt
it_cbafs = lt_cbafs
it_cbacn = lt_cbacn
it_cbacl = lt_cbacl
it_cbtpv = lt_cbtpv
it_texts = lt_texts
it_cbasd = lt_cbasd
IMPORTING
es_agreement = lc_agreement
e_log_number = lc_e_log_number
TABLES
t_messages = lt_messages
CHANGING
CT_VAKE = lt_vake
ct_konh = lt_konh
ct_konp = lt_konp
CT_KONW = lt_konw
CT_KONM = lt_konm
ct_komg = lt_komg
CT_USER_DATA = lt_usr_data
EXCEPTIONS
no_documents_to_process = 1
no_authorization = 2
creation_failed = 3
new_pricing_not_maitained = 4
OTHERS = 5.
IF sy-subrc <> 0.
Implement suitable error handling here
ELSE.
MOVE: lc_agreement-knuma_ag TO po_agreement,
lc_agreement-knuma_ag TO lc_kona-knuma.
ENDIF.
APPEND LINES OF lt_messages TO gt_messages.
ELSE.
MOVE-CORRESPONDING kona TO lc_kona.
ENDIF.
LOOP AT lt_konh ASSIGNING <konh_line>.
MOVE lc_kona-knuma TO <konh_line>-vakey+0(10).
move '&' to <konh_line>-knumh+0(1).
ENDLOOP.
LOOP AT lt_konp ASSIGNING <konp_line>.
MOVE lc_kona-knuma TO <konp_line>-vakey+0(10).
move '&' to <konh_line>-knumh+0(1).
ENDLOOP.
lc_kona-updkz = 'U'.
lc_cbasp-updkz = 'U'.
CLEAR lt_messages.
CALL FUNCTION '/IRM/IPCB_AGREEMENT_CHANGE'
EXPORTING
I_MESSAGES_DISPLAY = ' '
I_SAVE_MESSAGES = ' '
I_COMMIT_WORK = 'X'
I_INIT_DATA = 'X'
is_kona = lc_kona
is_cbasp = lc_cbasp
it_cbapr = lt_cbapr
it_cbadt = lt_cbadt
it_cbafs = lt_cbafs
it_cbacl = lt_cbacl
it_cbacn = lt_cbacn
IT_FIELDS =
it_texts = lt_texts
IMPORTING
e_log_number = lc_e_log_number
TABLES
t_messages = lt_messages
CHANGING
cs_agreement = lc_agreement
CT_VAKE = lt_vake
ct_konh = lt_konh
ct_konp = lt_konp
CT_KONW = lt_konw
CT_KONM = lt_konm
ct_komg = lt_komg
CT_USER_DATA = lt_usr_data
EXCEPTIONS
no_documents_to_process = 1
no_authorization = 2
change_failed = 3
agreement_locked = 4
OTHERS = 5.
IF sy-subrc <> 0.
Implement suitable error handling here
ENDIF.
APPEND LINES OF lt_messages TO gt_messages.
ENDFORM. " CREATE_AGREEMENT -
How to create the funtion module with step by step
friends can u help me regarding how to create the function module very urgent,
regards
bhavaniTo create a function module, you first need to create a Function Group which will keep all the function module of same functionality.
To create a Function Group, go to SE80->Click on Workbench-Edit Object->Function Group Tab->Enter Function Group name-> Click Create.
To create a Function Module:
Go to T.Code SE37->Enter the Function name->Enter Function Group name n Short Des.-> Here you need to define Import, Export parameters with the condition. Also you can write your code in source code tab.
check this link
Converting seconds values
check the FM code. if you don't have this FM code, create it in SE37 and make use of it.
FM MONI_TIME_CONVERT
FUNCTION MONI_TIME_CONVERT.
""Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(LD_DURATION) TYPE SY-TABIX
*" EXPORTING
*" REFERENCE(LT_OUTPUT_DURATION) TYPE SWL_PM_CVH-DURATION
DATA: LD_HOUR(4) TYPE N. "
DATA: LD_MIN(4) TYPE N. "
DATA: LD_SEC(4) TYPE N. "
DATA: LD_VALUE2(2) TYPE N.
DATA: LD_VALUE3(3) TYPE N.
DATA: LD_VALUE4(4) TYPE N.
DATA: SAVE_DURATION LIKE SY-TABIX.
data: ld_minus(1).
SAVE_DURATION = LD_DURATION.
if ld_duration < 0.
save_duration = save_duration * ( -1 ).
ld_minus = true.
endif.
CLEAR LT_OUTPUT_DURATION.
IF SAVE_DURATION NE 0.
LD_HOUR = SAVE_DURATION DIV 3600.
save_duration = save_duration - ld_hour * 3600.
LD_MIN = SAVE_DURATION DIV 60.
save_duration = save_duration - ld_min * 60.
LD_SEC = SAVE_DURATION.
IF LD_HOUR LE 100.
LD_VALUE2 = LD_HOUR.
WRITE LD_VALUE2 TO LT_OUTPUT_DURATION+3(2).
ELSEIF LD_HOUR LE 1000.
LD_VALUE3 = LD_HOUR.
WRITE LD_VALUE3 TO LT_OUTPUT_DURATION+2(3).
ELSE.
LD_VALUE4 = LD_HOUR.
WRITE LD_VALUE4 TO LT_OUTPUT_DURATION(4).
ENDIF.
WRITE ':' TO LT_OUTPUT_DURATION+5.
LD_VALUE2 = LD_MIN.
WRITE LD_VALUE2 TO LT_OUTPUT_DURATION+6(2).
WRITE ':' TO LT_OUTPUT_DURATION+8.
LD_VALUE2 = LD_SEC.
WRITE LD_VALUE2 TO LT_OUTPUT_DURATION+9(2).
LT_OUTPUT_DURATION = LT_OUTPUT_DURATION+1.
if ld_minus = true.
write '-' to lt_output_duration+1(1).
endif.
ELSE.
job running or aborted
ENDIF.
ENDFUNCTION.
Eg:2
Use the following procedure to create a function module
1.From the ABAP/4 Development Workbench screen, press the Function Library button on the Application toolbar.
2.Type the name of your function module in the Function Module field. The name must begin with Y_ or Z_.
3.Press the Create button. The Function Module Create: Administration screen is shown
4.Type the name of a function group in the Function Group field. The function group name must be four characters long and must begin with Y or Z.
5.Type an S in the Application field. This field is used to indicate which function area uses the function module. Our functionality is not used by any functional area, it is simply an example, so any choice will do. (S indicates that the function module contains functionality needed by Basis.)
6.Type a description of the function module in the Short Text field. The contents of this field are seen when displaying a list of function modules.
Press the Save button on the Application toolbar.
7.If the function group does not already exist, a pop-up informs you of that fact and asks you if you want to create it. Press the Yes button to create the function group. The Create Function Group dialog box appears. Type a description in the Short Text field and press the Save button. The Create Object Catalog Entry screen appears. Press the Local Object button. You are returned to the Function Module Change: Administration screen.
8.Press the Source Code button on the Application toolbar. The Function Module Edit screen is displayed.
9.Type the source code for your function module. Do not change the system-generated comment lines under any circumstances! Your function module might fail to operate if you do.
10.Press the Save button on the Application toolbar. The message Program xxxxx saved appears in the status bar at the bottom of the window.
11.Press the Back button on the Application toolbar. You are returned to the Function Library Initial screen.
12.If you want to define import or export parameters, select the Import/Export Parameter Interface radio button. Press the Change pushbutton. You are shown the Import/Export Parameters screen (refer to Figure 19.6). Type the names of your parameters in the first column and enter any other desired characteristics for each parameter. When you are finished, press the Save button and then the Back button.
13.Finally, to activate your function module, press the Activate button on the Application toolbar of the Function Library Initial Screen.
http://www.erpgenie.com/abap/bapi/example.htm -
How to use the function module 'HR_ES_FEATURE_BACKFIELD'
Hi,
How to use the function module 'HR_ES_FEATURE_BACKFIELD'?
I need the usage from both technical as well as functional point of view.
What is the use of this function module and technically how it is to be used to retrieve a feature for a particular employee.hey iam from functional side can u be little bit clear of that feature
thanks
sikindar -
How to test the SAP modules like SD and MM By using Quality Center and QTP
Hi Experts,
How to test the SAP modules like SD and MM By using Quality Center and QTP. Can you please provide the documentation regarding this.
Regards,
Skumar.Hi Sampath,
First install QTP and SAP Addin with in QTP.
2nd use QC to develop the test plan and then convert that test plan design to Test Scripts (QTP vesrion using settings)
3rd record the R/3 GUI screen of SAP for SD, MM like Create order or Create PR.
Once recording is done QTP will create a script in VB
SAPGuiSession("Session").SAPGuiWindow("SAP Easy Access - User").SAPGuiOKCode("OKCode").Set "/nVA01"
SAPGuiSession("Session").SAPGuiWindow("SAP Easy Access - User").SendKey ENTER
you can always add a parameter and other customization according to your requirement.
Let me know if you need more information regarding this.
Good Luck!
Maybe you are looking for
-
I am trying to create a document in Pages for iPad and want to highlight various bits of text but can not find a function in the inspector for this. Can anyone help,please?
-
IPhoto no longer works with Nikon 5100 after upgrade to 10.8
IPhoto with newly installed Mountain Lion no longer recognizes a connection to my Nikon 5100. The USB cable is good, as it works with my other Macs -- OSX versions 10.6.8 and 10.7.4, just as it did with my Imac before I upgraded to 10.8. My Pref
-
How to drag and drop files between two JFileChooser
Sir i want to drag and drop files between two JFileChooser i don't know how to do that. So is there any reference code for that so that i can able to do it. I have enabled setDragEnabled(true) for both the jfilechooser now i don't now how to drop fil
-
Hi, I need to save strings in different langauges in the DB, up to 24 bytes. How can i substring by bytes in java? for example: Èçðàèëü - is 14 bytes, but the string length is 7 hhhhhhh - is 7 bytes and the string length is 7. i would like to cut it
-
Illustrator CS6 blend mode spacing
I am trying to create a train track that vanishes into the horizon. I created the first parralell piece and a tiny one on the horizon and used blend to fill in the gaps. However as you can see from the pic below (where I have included images of the s