2015 Aug 26 6:10 AM
Hi experts,
Good day i am creating custom info-type from abap program by using HR_INFOTYPE_OPERATION, Program is terminating at line num 270 :
"ASSIGN record TO <record> CASTING TYPE (tabname). "XDP UniCode"
over here tabname value is like P9999 but actual table is PA9999
The very first statement of this FM is :
DATA TABNAME LIKE DNTAB-TABNAME VALUE 'P'.
so how can i change the vlaue from P to PA.
Thanks in advance,
Hafiz.
2015 Aug 26 7:30 AM
Dear ,
here is my complete code you can take a look .
DATA: wa_pa9999TYPE pa9999.
* l_bapireturn TYPE BAPIRETURN1,
* bapipakey_tab TYPE BAPIPAKEY.
ADD 1 TO wa_pa9999-seqnr.
wa_pa9999-subty = SBTYPE .
wa_pa9999-endda = ENDDATE.
wa_pa9999-begda = STARTDATE .
***Locking the object
CALL FUNCTION 'ENQUEUE_EPPRELE'
EXPORTING
pernr = PNO
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '9999'
number = PNO
subtype = wa_pa999-subty
* objectid = wa_pa9999-objps
* lockindicator = wa_pa9999-sprps
validityend = wa_pa9999-endda
validitybegin = wa_pa9999-begda
* recordnumber = wa_pa9999-seqnr
record = wa_pa999
operation = 'MOD'
TCLAS = 'A'
DIALOG_MODE = '0'
nocommit = space
IMPORTING
return = LBAPIRETURN
key = BAPIPAKEYTAB
.
***Unlocking the object
CALL FUNCTION 'DEQUEUE_EPPRELE'
EXPORTING
pernr = PNO.
write pno.
ENDFUNCTION.
2015 Aug 26 6:21 AM
you mean to say that you are inserting record in a custom infotype "9999" using the FM. Please do the following first:
Regards
Mehwish
2015 Aug 26 6:31 AM
Dear Mehwish ,
First step is working fine
Here is my code:
all function 'HR_INFOTYPE_OPERATION'
exporting
infty = '9999'
number = 10000245
subtype = 9015
validityend = 05.02.2015
validitybegin = 05.02.2015
recordnumber = 000
record = pa9999
operation = 'INS'
tclas = 'A'
dialog mode = '0'
importing
return = l_return.
so again my question is FM: HR_INFOTYPE_OPERATION is valid for PA right??
2015 Aug 26 6:46 AM
Hi,
How are you declaring PA9999 it should be type P9999 as declared below.
data: pa9999 type p9999.
now pass pa9999 to the FM and it should work.
2015 Aug 26 7:08 AM
Dear Gaurav,
I'm using FM HR_INFOTYPE_OPERATION
not declaring any thing
2015 Aug 26 7:26 AM
Please share your complete code with declarations.
Regards
Mehwish
2015 Aug 26 7:27 AM
Hi,
all function 'HR_INFOTYPE_OPERATION'
exporting
infty = '9999'
number = 10000245
subtype = 9015
validityend = 05.02.2015
validitybegin = 05.02.2015
recordnumber = 000
record = pa9999 ---------> Please decalre this Work area as ' Data : pa9999 type p9999.
operation = 'INS'
tclas = 'A'
dialog mode = '0'
importing
return = l_return.
It will solve your issue...
Thanks,
Vijay SR
2015 Aug 26 7:31 AM
2015 Aug 26 7:34 AM
Dear Vijay,
Please take a look to my latest post i've shared my complete code
2015 Aug 26 7:41 AM
Hi,
Its ok , but you have to change the data decalaration part...
DATA: wa_pa9999TYPE pa9999. --> Dont decalare as pa9999, instead declare the structure p9999...
Data : wa_pa9999TYPE p9999.
Change and check...
Thanks,
Vijay Sr
2015 Aug 26 7:13 AM
How did you create the custom Infotype, table PA9xxx and structure P9xxx should be similar/compatible:
Hint: FM expect P9xxx structure, not PA9xxx. (check FM and online documentation and perform some where-used search)
Regards,
Raymond
2015 Aug 26 7:20 AM
The name doesn't matter.
I has to be the structure of your Infotype, not a table or variable....
data: pa9999 type p9999. (from Gaurav Dubey)
or
Data: ls_record type p9999,
or
myrecordneme type p9999.
2015 Aug 26 7:30 AM
Dear ,
here is my complete code you can take a look .
DATA: wa_pa9999TYPE pa9999.
* l_bapireturn TYPE BAPIRETURN1,
* bapipakey_tab TYPE BAPIPAKEY.
ADD 1 TO wa_pa9999-seqnr.
wa_pa9999-subty = SBTYPE .
wa_pa9999-endda = ENDDATE.
wa_pa9999-begda = STARTDATE .
***Locking the object
CALL FUNCTION 'ENQUEUE_EPPRELE'
EXPORTING
pernr = PNO
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '9999'
number = PNO
subtype = wa_pa999-subty
* objectid = wa_pa9999-objps
* lockindicator = wa_pa9999-sprps
validityend = wa_pa9999-endda
validitybegin = wa_pa9999-begda
* recordnumber = wa_pa9999-seqnr
record = wa_pa999
operation = 'MOD'
TCLAS = 'A'
DIALOG_MODE = '0'
nocommit = space
IMPORTING
return = LBAPIRETURN
key = BAPIPAKEYTAB
.
***Unlocking the object
CALL FUNCTION 'DEQUEUE_EPPRELE'
EXPORTING
pernr = PNO.
write pno.
ENDFUNCTION.
2015 Aug 26 7:32 AM
hi,
Change
DATA: wa_pa9999TYPE p9999
instead of
DATA: wa_pa9999TYPE pa9999. (not pa9999)
thanks,
Vijay SR
2015 Aug 26 7:34 AM
2015 Aug 26 7:43 AM
Hi,
Thanks it's help alot but info type is not calculating days and inserted record for value as 0.
Regards,
Hafiz
2015 Aug 26 7:43 AM
Hi,
Thanks it's help alot but info type is not calculating days and inserted record for value as 0.
Regards,
Hafiz
2015 Aug 26 7:46 AM
Hi Hafiz,
1) In Exporting parameter ''record'' parameter is passed by wa_pa999 and it is not declared
anywhere in your above code.
2) And I see that you have defined wa_pa9999 type pa9999 and passed the value to this work area,
Instead you define wa_pa9999 as
data: wa_pa9999 type p9999. and check once.
Regards,
Shadab.
2015 Aug 26 7:46 AM
Share snapshot of your infotype with fields. Does it calculate days automatically when you press enter or save in PA30?
Regards
Mehwish
2015 Aug 26 7:56 AM
Dear Mehwish,
Thanks for your help i've done it by using commit after FM.
Thanks alot