RPTIME00 - Custom Internal Table , Custom Clsuter in Custom Function.
Hello Guru,
I have a requirement to create custom scheme with totally new custom function , rules .
my question is it is possible to declare custom internal tables like TIP, TOP and cutom cluster to store results.
if yes then how ?
Thanks in adance
My requirement is based on a project to develop new sap product which can handle complex crew management for industries like railways and airlines,product is still in protoype phase and will basicaly cover right from dispatching crew to various sites to generating there payroll. standard sap works on basis of day and time. but crew industory work on trip. a crew for example pilot fly form point A to B get paid/claims based on on that single trip and whatever activities he has done in that trip. so purely this is based on trip and not day or hours, now we are thinking about using RPTIMEOO as a tool to calculate and create wage type beacuse at the end of the day payroll is getting generated in SAP and also all the crew employee will be setup as master data. this whole product will have its own screeen to capture activties and opereations . will be build on top of sap hcm.
so was thinking any ways sap says that you can create custom schema and rules but those standard internal tables and cluster are of no use because of the structure is based in trip, wage type will be based in miles that crew travel.
so trying to find how far this RPTIME00 is flexible .. and is possible to create custom function. becoz at end we are going to update payroll 2010 which can be mapped some how. RPTIME00 can also give clients to add there own custom functions in future if any new req comes.
if this is not possible i.e RPTIMEOO can not use custom cluster , then we might have to write abap programs ti do calculation but only problem any new features to be added will lead to code change.
thanks for your patience ..
Similar Messages
-
How to Import customized internal table to smartform from Print Program
Hi Gurus,
I want to Import customized internal table to smartform from print program, Can anybody tell me how it is possible.
With regards,
S.SaravananThere is no problem passing an internal table to a smarforms, smartforms have the same interface as a function module ([Defining the Form Interface|http://help.sap.com/saphelp_nw70/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/frameset.htm] in [Smart Forms|http://help.sap.com/saphelp_nw70/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm]) so could you elaborate a little more on your requirement (is it a standard a custom forms, etc.)
Regards,
Raymond -
How to Send Internal table to SAP Spool using Function Modules or Methods?
Hi Experts,
How to Send Internal table to SAP Spool using Function Modules or Methods?
Thanks ,
KiranThis is my code.
I still get the no ABAP list data for the spool, even tho I can see it sp01?
REPORT Z_MAIL_PAYSLIP.
* Declaration Part *
tables: PERNR, PV000, T549Q, V_T514D, HRPY_RGDIR.
infotypes: 0000, 0001, 0105, 0655.
data: begin of ITAB occurs 0,
MTEXT(25) type C,
PERNR like PA0001-PERNR,
ABKRS like PA0001-ABKRS,
ENAME like PA0001-ENAME,
USRID_LONG like PA0105-USRID_LONG,
end of ITAB.
data: W_BEGDA like HRPY_RGDIR-FPBEG,
W_ENDDA like HRPY_RGDIR-FPEND.
data: RETURN like BAPIRETURN1 occurs 0 with header line.
data: P_INFO like PC407,
P_FORM like PC408 occurs 0 with header line.
data: P_IDX type I,
MY_MONTH type T549Q-PABRP,
STR_MY_MONTH(2) type C,
MY_YEAR type T549Q-PABRJ,
STR_MY_YEAR(4) type C,
CRLF(2) type x value '0D0A'.
data: W_CMONTH(10) type C.
data: TAB_LINES type I,
ATT_TYPE like SOODK-OBJTP.
data: begin of P_INDEX occurs 0,
INDEX type I,
end of P_INDEX.
constants: begin of F__LTYPE, "type of line
CMD like PC408-LTYPE value '/:', "command
TXT like PC408-LTYPE value 's', "textline
end of F__LTYPE.
constants: begin of F__CMD, "commands
NEWPAGE like PC408-LINDA value '',
end of F__CMD.
data: P_LIST like ABAPLIST occurs 1 with header line.
*data: OBJBIN like SOLISTI1 occurs 10 with header line,
data: OBJBIN like LVC_S_1022 occurs 10 with header line,
DOCDATA like SODOCCHGI1,
OBJTXT like SOLISTI1 occurs 10 with header line,
OBJPACK like SOPCKLSTI1 occurs 1 with header line,
RECLIST like SOMLRECI1 occurs 1 with header line,
OBJHEAD like SOLISTI1 occurs 1 with header line,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_buffer type string,
l_no_of_bytes TYPE i,
l_pdf_spoolid LIKE tsp01-rqident,
l_jobname LIKE tbtcjob-jobname.
data: file_length type int4,
spool_id type rspoid,
line_cnt type i.
*-------------------------------------------------------------------* * INITIALIZATION *
OBJBIN = ' | '.
append OBJBIN.
OBJPACK-HEAD_START = 1.
data: S_ABKRS like PV000-ABKRS.
data: S_PABRP like T549Q-PABRP.
data: S_PABRJ like T549Q-PABRJ.
* SELECTION SCREEN *
selection-screen begin of block BL1.
parameters: PAY_VAR like BAPI7004-PAYSLIP_VARIANT default 'ESS_PAYSLIPS' obligatory.
selection-screen end of block BL1.
START-OF-SELECTION.
s_ABKRS = PNPXABKR.
S_PABRP = PNPPABRP.
s_pabrj = PNPPABRJ.
w_begda = PN-BEGDA.
w_endda = PN-ENDDA.
get pernr.
* "Check active employees
rp-provide-from-last p0000 space pn-begda pn-endda.
CHECK P0000-STAT2 IN PNPSTAT2.
* "Check Payslip Mail flag
rp-provide-from-last p0655 space pn-begda pn-endda.
CHECK P0655-ESSONLY = 'X'.
rp-provide-from-last p0001 space pn-begda pn-endda.
* "Find email address
RP-PROVIDE-FROM-LAST P0105 '0030' PN-BEGDA PN-ENDDA.
if p0105-usrid_LONG ne ''.
ITAB-PERNR = P0001-PERNR.
ITAB-ABKRS = P0001-ABKRS.
ITAB-ENAME = P0001-ENAME.
ITAB-USRID_LONG = P0105-USRID_LONG.
append itab.
clear itab.
endif.
"SY-UCOMM ='ONLI'
END-OF-SELECTION.
*------------------------------------------------------------------* start-of-selection.
write : / 'Payroll Area : ', S_ABKRS.
write : / 'Payroll Period/Year : ',STR_MY_MONTH,'-',STR_MY_YEAR. write : / 'System Date : ', SY-DATUM.
write : / 'System Time : ', SY-UZEIT.
write : / 'User Name : ', SY-UNAME.
write : / SY-ULINE.
sort ITAB by PERNR.
loop at ITAB.
clear : P_INFO, P_FORM, P_INDEX, P_LIST, OBJBIN, DOCDATA, OBJTXT, OBJPACK, RECLIST, TAB_LINES.
refresh : P_FORM, P_INDEX, P_LIST, OBJBIN, OBJTXT, OBJPACK, RECLIST.
* Retrieve Payroll results sequence number for this run
select single * from HRPY_RGDIR where PERNR eq ITAB-PERNR
and FPBEG ge W_BEGDA
and FPEND le W_ENDDA
and SRTZA eq 'A'.
* Produce payslip for those payroll results
if SY-SUBRC = 0.
call function 'GET_PAYSLIP'
EXPORTING
EMPLOYEE_NUMBER = ITAB-PERNR
SEQUENCE_NUMBER = HRPY_RGDIR-SEQNR
PAYSLIP_VARIANT = PAY_VAR
IMPORTING
RETURN = RETURN
P_INFO = P_INFO
TABLES
P_FORM = P_FORM.
check RETURN is initial.
* remove linetype from generated payslip
loop at p_form.
objbin = p_form-linda.
append objbin.
line_cnt = line_cnt + 1.
endloop.
file_length = line_cnt * 1022.
* create spool file of paylsip
CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
EXPORTING
i_file_length = file_length
IMPORTING
e_spoolid = spool_id
TABLES
it_textdata = objbin.
IF sy-subrc EQ 0.
WRITE spool_id.
ENDIF.
DESCRIBE table objbin.
DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = spool_id
NO_DIALOG = ' '
DST_DEVICE = 'MAIL'
* PDF_DESTINATION =
* IMPORTING
* PDF_BYTECOUNT = l_no_of_bytes
* PDF_SPOOLID = l_pdf_spoolid
* LIST_PAGECOUNT =
* BTC_JOBNAME =
* BTC_JOBCOUNT =
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Download PDF file C Drive
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\itab_to_pdf.pdf'
filetype = 'BIN'
TABLES
data_tab = pdf.
* Transfer the 132-long strings to 255-long strings
* LOOP AT pdf.
* TRANSLATE pdf USING ' ~'.
* CONCATENATE gd_buffer pdf INTO gd_buffer.
* ENDLOOP.
* TRANSLATE gd_buffer USING '~ '.
* DO.
* it_mess_att = gd_buffer.
* APPEND it_mess_att.
* SHIFT gd_buffer LEFT BY 255 PLACES.
* IF gd_buffer IS INITIAL.
* EXIT.
* ENDIF.
* ENDDO.
OBJHEAD = 'Objhead'.
append OBJHEAD.
* preparing email subject
concatenate W_ENDDA(6)
' Payslip-'
ITAB-ENAME+0(28)
ITAB-PERNR+4(4) ')'
into DOCDATA-OBJ_DESCR.
DOCDATA-OBJ_NAME = 'Pay Slip'.
DOCDATA-OBJ_LANGU = SY-LANGU.
OBJTXT = 'Pay Slip.'.
append OBJTXT.
*prepare email lines
OBJTXT = DOCDATA-OBJ_DESCR.
append OBJTXT.
OBJTXT = 'Please find enclosed your current payslip.'.
append OBJTXT.
* Write Attachment(Main)
* 3 has been fixed because OBJTXT has fix three lines
read table OBJTXT index 3.
* DOCDATA-DOC_SIZE = ( 3 - 1 ) * 255 + strlen( OBJTXT ).
clear OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = 3.
OBJPACK-DOC_TYPE = 'RAW'.
append OBJPACK.
* Create Message Attachment
ATT_TYPE = 'PDF'.
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 = 'Payslip'.
append OBJPACK.
* Create receiver list refresh RECLIST.
clear RECLIST.
RECLIST-RECEIVER = itab-USRID_long.
translate RECLIST-RECEIVER to lower case.
RECLIST-REC_TYPE = 'U'.
append RECLIST.
* Send the document
*SO_NEW_DOCUMENT_ATT_SEND_API1
call function 'SO_DOCUMENT_SEND_API1'
exporting
DOCUMENT_DATA = DOCDATA
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
tables
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = pdf
CONTENTS_TXT = OBJTXT
* CONTENTS_HEX =
* 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 NE 0.
ITAB-MTEXT = 'Message Not Sent to : '.
else.
ITAB-MTEXT = 'Message Sent to : '.
endif.
* else.
* ITAB-MTEXT = 'Message Not Sent to : '.
* endif.
else.
"SY-SUBRC Not = 0
ITAB-MTEXT = 'Payroll data not found : '.
endif.
"end of SY-SUBRC = 0.
modify ITAB.
endloop. "end loop at ITAB
sort ITAB by MTEXT PERNR.
loop at ITAB.
at new MTEXT.
uline.
write : / ITAB-MTEXT color 4 intensified on.
write : / 'Emp. Code' color 2 intensified on,
12 'Emp. Name' color 2 intensified on,
54 'Email ID' color 2 intensified on.
endat.
write : / ITAB-PERNR, 12 ITAB-ENAME, 54 ITAB-USRID_LONG.
endloop. -
Accessing internal table of main program inside function module...
I have function module say ZFUNC and main program say ZMAIN and internal table defined as IT_TAB inside ZMAIN but not passed as parameter to Function module ZFUNC.
If I want to access the field value of IT_TAB of main program ZMAIN inside ZFUNC during debugging then, I simply put <b>(ZMAIN)IT_TAB-amount</b> in ABAP debugger and then change it when the debugger is inside ZFUNC.
How can I write code to change the value of internal table of main program in function module ZFUNC instead of doing in debugger ? I guess I have to use some field symbols, but not sure. Please suggest.
Regards,
Rajesh.Yes, you do need to use a field symbol. Say for example, you had a internal table called IMARC in your program and you want to access it later in a funciton module, you would do something like this.
data: xmarc type marc.
field-symbols: <imarc> type marc_upl_tt.
* Assign an internal table
field = '(ZPROGRAM_NAME)IMARC[]'.
assign (field) to <imarc>.
loop at <imarc> into xmarc.
write: / xmarc-matnr, xmarc-werks.
endloop.
Regards,
Rich Heilman -
Internal table value checking in custom table using SQL...
I have a table which has following fields:
X1 TABLE (ZCONfig custom table)
LIFNR land1
123 br
234 br
456 br
567 Gr
and
X2 TABLE: (Internal table)
LIFNR:
234
567
123
Now I want to see if all the field values of LIFNR in internal table X2 (X2-LIFNR) are present in X1 or not.
Raise error if it is not.
How do I do this using SQL ? I guess I have to use read statement.
Please help. Points will be awarded.
Thanks.
RegardsHi Tushar,
1 Ya u are right , we need to use READ statement.
2. Populate X1 (all records)
in an internal table.
3. Then Loop at X2
and compare with X1.
( u can also keep an extra field in X2
of type c, so that if a record is found,
mark it as X )
4. try this code (just copy paste)
REPORT abc.
DATA : BEGIN OF itab OCCURS 0,
bukrs LIKE t001-bukrs,
present TYPE c,
END OF itab.
DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
itab-bukrs = '1000'.
APPEND itab.
itab-bukrs = 'X000'.
APPEND itab.
SELECT * FROM t001 INTO TABLE t001.
LOOP AT itab.
READ TABLE t001 with key bukrs = itab-bukrs.
IF sy-subrc = 0.
itab-present = 'X'.
MODIFY itab.
ENDIF.
ENDLOOP.
BREAK-POINT.
regards,
amit m.
Message was edited by: Amit Mittal -
(internal) Tables obsolete as parameter in function modules,
Hi
As you probably can see by the question, my ABAP Knowledge isn't exactly overwhelming !
<i>anyway:</i>
I'm trying to create a function module in NW2004s, This functionmodule should take an internal table, based on a structure as (import) parameter.
In the earlier version, I've done this by defining it under the TAB 'Tables' in the function builder - But know its telling me that "<i>Tables Parameters are obsolete</i>", and that I should define it under "Changing" instead.
I have tried that, but I'm only allowed to pass a single line, and if I try to do a Loop, in the function module, it tells me that ity isn't created as an internal table.
So please - what is the "best practice" here ?
Regards
Morten NielsenHi All,
I followed Steps 1 and 2 but when I use the following select statement I get a dump with the error enclosed.
Step1. Created a structure ZDFKKCOHI which is a replica of DFKKCOHI.
Step2. Created a table type ZDFKKCOHITABLE with line type as ZDFKKCOHI.
Step3. In my function module I have a changing parameter ZDFKKCOHIPARAM of type ZDFKKCOHITABLE.
Step 4. When I use the following select clause I am getting a dump.
DATA: wa_zdfkkcohi LIKE LINE OF zdfkkcohiparam.
SELECT *
FROM dfkkcohi
INTO CORRESPONDING FIELDS OF TABLE zdfkkcohiparam
WHERE cotyp EQ zcotyp
AND gpart EQ zgpart
AND corr_status EQ zcorr_status.
LOOP AT zdfkkcohiparam INTO wa_zdfkkcohi.
*Move IT_ZDFKKCOHI to ZDFKKCOHIOUT.
*Append ZDFKKCOHIOUT.
*Clear IT_ZDFKKCOHI.
ENDLOOP.
What could be wrong?
Thanks for all your help in advance.
Regards,
Divya -
Pass internal tables in Export Parameters of Function Module
Hi
How to pass internal tables through export parametes of the calling function module. i
think i can pass it by reference ....
if so can anyone suggest how to do it?Hi,
You can Export values of an Internal table in two ways, by :
1) specifying in Tables tab
(Not recommended since it's an obsolete in ECC 6.0)
If used, will reduce the performance of the FM
Tables are always passed by reference
2) specifying in Exports tab.
The parameter should be a Table type (created in se11)
having a Line type that refers to the structure of the data.
Pass by Value is not used for Normal Function modules.
Used usually for RFC enabled FMs.
Cheers,
Remi -
(internal) Tables obsolete as parameter in function modules in ECC 6.0
Hi All,
I followed Steps 1 and 2 in the thread but when I use the following select statement I get a dump with the error enclosed.
Step1. Created a structure ZDFKKCOHI which is a replica of DFKKCOHI.
Step2. Created a table type ZDFKKCOHITABLE with line type as ZDFKKCOHI.
Step3. In my function module I have a changing parameter ZDFKKCOHIPARAM of type ZDFKKCOHITABLE.
Step 4. When I use the following select clause I am getting a dump.
DATA: wa_zdfkkcohi LIKE LINE OF zdfkkcohiparam.
SELECT *
FROM dfkkcohi
INTO CORRESPONDING FIELDS OF TABLE zdfkkcohiparam
WHERE cotyp EQ zcotyp
AND gpart EQ zgpart
AND corr_status EQ zcorr_status.
LOOP AT zdfkkcohiparam INTO wa_zdfkkcohi.
*Move IT_ZDFKKCOHI to ZDFKKCOHIOUT.
*Append ZDFKKCOHIOUT.
*Clear IT_ZDFKKCOHI.
ENDLOOP.
Error: Das laufende ABAP-Programm wollte eine Open SQL-Anweisung ausführen,
bei der die Treffermenge mit 'INTO CORRESPONDING FIELDS' in
namensgleiche Felder der Zielbereichs gestellt werden soll. Hierbei
müssen die namensgleichen Felder des Zielbereichs einen flachen Typ
haben, oder vom Typ STRING oder XSTRING sein.
Im vorliegenden Fall enthält der Zielbereich " " aber ein
namensgleiches Feld "MANDT " mit dem verbotenen internen Typ "l".
What could be wrong?
Thanks for all your help in advance.
Regards,
DivyaTranslating the error message -;)
The running ABAP-program wanted to carry out an opus SQL-direction, with which the hit quantity with 'INTO
CORRESPONDING FIELDS' is supposed to be placed into name same fields the goal area. Herewith the name same
fields of the goal area must have be a flat type, or of the type STRING or XSTRING.
In the existing case, the goal area "" contains however a name same field "MANDT" with the forbidden internal type "l".
You should check you structures and assign the correct TYPE to the fields -:)
Greetings,
Blag. -
Getting the internal table of standard program to my custom program
Hi All,
I have a requirement in which i have to get the data from internal table ALV_ITAB from program HKBRO20. As this is the standard program, i have copied this program into Z custom program and using export parameter i am getting the data from internal table ALV_ITAB to my custom program (Using submit of the Z of the standard program). Can any one pls tell me whether the process i am following is correct if not pls tell me how to get the internal table from standard program to our custom program.
the process i am following
submit ZHBRO20 and return. IMPORT ALV_ITAB FROM MEMORY ID 'ABC'.
copied HBRO20 to ZHBRO20.
Thanks,
RajuHi,
you could also try
FIELD-SYMBOLS: <fc> .
CONSTANTS: c_table(21) VALUE '(PROGRAM_NAME)INTERNAL_TABLENAME[]'.
ASSIIGN (c_table) TO <fc>.
Depends on the process, of course.
Cheers,
Stefan. -
Problem in Internal table Record Splitting
Hi All,
Plz look into my below requirement and me know your Suggestions.
My Internal tables :
1.*Internal table for Infotype 2002 (Attendances)
DATA : BEGIN OF T_PA2002 OCCURS 0,
PERNR LIKE PA2002-PERNR,
BEGDA LIKE PA2002-BEGDA,
ENDDA LIKE PA2002-ENDDA,
BEGUZ LIKE PA2002-BEGUZ,
ENDUZ LIKE PA2002-ENDUZ,
SUBTY LIKE PA2002-SUBTY,
END OF T_PA2002.
1.*Internal table for Infotype 9003 (Custom Attendances)
DATA : BEGIN OF T_PA9003HRABS OCCURS 0,
PERNR LIKE PA9003-PERNR,
BEGDA LIKE PA9003-BEGDA,
ENDDA LIKE PA9003-ENDDA,
SHIFT LIKE PA9003-SHIFT,
OTHOURS LIKE PA9003-OTHOURS,
BEGUZ LIKE PA2002-BEGUZ,
ENDUZ LIKE PA2002-ENDUZ,
NSA LIKE PA9003-NSA,
MA LIKE PA9003-MA,
CA LIKE PA9003-CA,
END OF T_PA9003HRABS.
Requirement :
1. Internal table T_PA2002
PERNR BEGDA ENDDA BEGUZ ENDUZ
5 27.12.2006 27.12.2006 10:00:00 14:30:00
2. Internal table T_PA9003HRABS
PERNR BEGDA ENDDA BEGUZ ENDUZ HRABS OTHOURS MA CA WA
5 27.12.2006 27.12.2006 08:00:00 14:30:00 2 2
Iam doing comparision between T_PA2002 and T_PA9003HRABS.
Iam doing some caluculation to get Hourly absence,OT Hours and else ( Fields)
So my Hourly absence on 27.12.2006 was 2Hours.
So i need to split my Final table as below how to do that....( It is like In infotypes COPY option i.e 1 record to 3 Record )
I need the Output like this...
3. Final Internal table T_PA9003HRABS
PERNR BEGDA ENDDA BEGUZ ENDUZ HRABS OTHOURS MA CA WA
5 25.12.2006 26.12.2006 08:00:00 14:30:00 0 0
5 27.12.2006 27.12.2006 08:00:00 14:30:00 2 2
5 25.12.2006 26.12.2006 08:00:00 14:30:00 0 0
Points will be rewarded.
Thanks,
Suresh.Uyou could:
sort T_PA2002 by pernr.
sort T_PA9003HRABS by pernr.
loop at T_PA2002
read table T_PA9003HRABS with key
pernr = T_PA2002-pernr
begda = T_PA2002-begda
binary search.
***here you can specify how you calculate
***your absences and apply them to your
***final internal table.
endloop.
hope this helps.
Warren -
Reg : Passing two internal table values in to final internal table
Dear Experts,
My first internal table looks like this,
Customer Name O/S
A Anu 5000
B Beema 2000
C Chitu 3000
My Second Internal table looks like this,
Customer InvNo InvDate Due
A 001 1/1/09 500
A 002 2/2/09 100
B 004 4/4/09 50
B 003 4/5/09 100
My final Internal table should be,
Customer Name O/s InvNo InvDate Due
A Anu 5000 001 1/1/09 500
002 2/2/09 100
B Beema 2000 004 4/4/09 50
003 4/5/09 100
Please help me with the code...Hai,
Thanks...
I need to get the O/P like this,
Customer Name O/S InvNo Inv Date Due
A Anu 3000 001 1/11/09 50
002 2/2/09 100
003 3/3/09 30
Plz help -
Converting rows to columns in internal tables
hi
i have an internal table with foll strcuture
customer jan feb mar apr jun july aug sep oct nov dec
a 1 2 3 4 5 6 7 8 9 10 11
b
c
n
i need to form another internal table whose ouput will be
month custA cust B custc cust d
jan 1
feb 2
mar 3
and so on
is this possible to do ? without dynamic internal tableIf you don't know number of records in 1st table in advance you must create dynamic table at runtime.
-
Internal table rows to columns
hi
i have an internal table with foll strcuture
customer jan feb mar apr jun july aug sep oct nov dec
a 1 2 3 4 5 6 7 8 9 10 11
b
c
n
i need to form another internal table whose ouput will be
month custA cust B custc cust d
jan 1
feb 2
mar 3
so depending upon the no of records of first internal table, columns need to be created in the new table with corresponding cusomters data.
how to proceed ?Check the links -
converting columns to rows
Convert Internal table Rows into columns of another internal table
Re: Moving columns of an internal table to rows of an another internal table.
Regards,
Amit
Reward all helpful replies. -
In my report.
I have select-option : for Material, Plant and Customer Region.
In my Ztable I have material group, Plant and Customer Region.
I want to fill my internal table as
Material
Plant
Customer Region.
How Can I do it, I am not getting the logic due to all in are in select-options.
Can anybody suggent me.
Thanks
kumar nHi Kumar,
Heres the rough logic that can be helpful to solve your problem:
SELECT *
FROM ZTABLE
INTO IT_ZTAB
FOR ALL ENTRIES IN IT_MARA
WHERE MAKTL = IT_MARA-MAKTL AND
WERKS = S_WERKS AND
REGIO = S_CUSTOMER_REGION.
LOOP AT IT_MARA INTO WA_MARA.
LOOP AT IT_ZTAB INTO WA_ZTAB WHERE MAKTL = WA_MARA-MAKTL.
**Logic to append all the entries into a single internal table.
MOVE-CORRESPONDING WA_MARA TO WA_FINAL_TAB.
MOVE-CORRESPONDING WA_ZTAB TO WA_FINAL_TAB.
APPEND WA_FINAL_TAB TO IT_FINAL_TAB.
ENDLOOP.
ENDLOOP.
Here IT_FINAL_TAB contains all the fields required by you.
Regards,
Kunjal -
PASSING INTERNAL TABLE IN SMARTFORM
HI' I M NEW TO SMARTFORMS, MY PROBLEM IS =THAT
I'VE CREATED A NEW TYPE(SAY TY_BKPF) IN THE DRIVER PROGRAM.
THEN I'VE DECLARED AN INTERNAL TABLE OF THIS TYPE.
TO PASS THIS INTERNAL TABLE INTO MY SMARTFORM I'VE PASSED THE INTERNAL TABLE'S NAME INTO THE FUNCTION MODULE UNDER THE TABLES PARAMETER.
BUT I'M NOT ABLE TO UNDERSTAND AS TO WHAT TYPE SHOULD I GIVE IT IN THE FORM INTERFACE IN THE TABLES TAB.
PLZ HELP.Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
Also have a look at below sample code. It will give you idea abt the same.
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
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.
Have a look at below link for more help on smart forms.
http://sap.ionelburlacu.ro/sap0/sapsf001.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
I hope it helps.
Best Regards,
Vibha
*Please mark all the helpful answers
Maybe you are looking for
-
Airport Extreme (old style) connecting to Plusnet router?
I'm upgrading to fibreoptic. Can I connect the Plusnet technicolor router to my Airport Extreme & thus the existing wifi network?
-
Hi. i want to find batch for material and the description for that particular batch.so in which table i get it? can anyone help me...
-
Help with printing out Speakable Items folder(s)
I have a visually impaired family member who would like to learn how to use spoken commands on her iMac. I have not been able to find a way to print out the "Speakable Items" folder(s) in order for us to let her know what exactly she can say; it is
-
Benefits of working in BI upgrade project
Hi, I will be embarking on BI upgrade project soon. and would like to know what are the benefits in terms of career working in such a project as a consultant. e.g what can I learn that will be useful in the future. what knowledge will be gained etc.
-
"Check for updates" in Apps-Section is greyed out
Hi, i recently have a problem when trying to update my Apps via iTunes. When i navigate to Library --> Apps (Left side bar) the "Check for updates"-Button/Text in the right bottom corner is greyed out. So i can't update my apps via iTunes. But there